This commit is contained in:
2015-11-15 18:18:42 +00:00
parent 9ac343fc45
commit 72be7b0c2f
580 changed files with 356252 additions and 6 deletions
+1
View File
@@ -0,0 +1 @@
# dummy
+1
View File
@@ -0,0 +1 @@
# dummy
+1
View File
@@ -0,0 +1 @@
# dummy
+1
View File
@@ -0,0 +1 @@
# dummy
+1
View File
@@ -0,0 +1 @@
Copyright (C) 2006 Erik Gilling
+340
View File
@@ -0,0 +1,340 @@
GNU GENERAL PUBLIC LICENSE
Version 2, June 1991
Copyright (C) 1989, 1991 Free Software Foundation, Inc.
59 Temple Place, Suite 330, Boston, MA 02111-1307 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 Library 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., 59 Temple Place, Suite 330, Boston, MA 02111-1307 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 Library General
Public License instead of this License.
+47
View File
@@ -0,0 +1,47 @@
2006-07-07 erik gilling <konkers@konkers.net>
* version 0.1.0
2006-07-07 erik gilling <konkers@konkers.net>
* add boot_from_flash command from Liam
2006-06-16 erik gilling <konkers@konkers.net>
* unlock_regions uses nvpsize not sramsiz
2006-06-16 erik gilling <konkers@konkers.net>
* fix lock bit detection
2006-06-16 erik gilling <konkers@konkers.net>
* fix configure.in to set OS options before looking for headers
* add read and read_manual commands
* add detection for number of lock bits
* fix unlock_regions for devices other than the S64
* remove exraneous debugging info
* add --exec command line for scriptability
2006-06-15 erik gilling <konkers@konkers.net>
* add win32 support (cygwin only for now)
2006-06-14 erik gilling <konkers@konkers.net>
* integrate loaders into sam7 binary
2006-06-14 erik gilling <konkers@konkers.net>
* remove endian swapping from write_half_word and write_word
2006-06-13 erik gilling <konkers@konkers.net>
* rename samba_flash to flash
* add support for 256 byte pages using flash command
2006-06-13 erik gilling <konkers@konkers.net>
* add loader code (tested on sam7s64)
2006-06-09 erik gilling <konkers@konkers.net>
* correct type matching for sam7x
* first stab at endianness correction (untested)
2006-06-08 erik gilling <konkers@konkers.net>
* read cpuid and size flash page
* print out chip info on init
2005-12-30 erik gilling <konkers@konkers.net>
* increment version to 0.0.2
* add manual_upload command which does not use samba.bin
+236
View File
@@ -0,0 +1,236 @@
Installation Instructions
*************************
Copyright (C) 1994, 1995, 1996, 1999, 2000, 2001, 2002, 2004, 2005 Free
Software Foundation, Inc.
This file is free documentation; the Free Software Foundation gives
unlimited permission to copy, distribute and modify it.
Basic Installation
==================
These are generic installation instructions.
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 only 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. If you're
using `csh' on an old version of System V, you might need to type
`sh ./configure' instead to prevent `csh' from trying to execute
`configure' itself.
Running `configure' takes awhile. 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=c89 CFLAGS=-O2 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 must use a version of `make' that
supports the `VPATH' variable, such as 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 `..'.
If you have to use a `make' that does not support the `VPATH'
variable, you have 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' will install the package's files in
`/usr/local/bin', `/usr/local/man', 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
give `configure' the option `--exec-prefix=PREFIX', the package will
use PREFIX as the prefix for installing programs and libraries.
Documentation and other data files will 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 `--target=TYPE' option 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). Here is a another example:
/bin/bash ./configure CONFIG_SHELL=/bin/bash
Here the `CONFIG_SHELL=/bin/bash' operand causes subsequent
configuration-related scripts to be executed by `/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.
+562
View File
@@ -0,0 +1,562 @@
# Makefile.in generated by automake 1.9.6 from Makefile.am.
# Makefile. Generated from Makefile.in by configure.
# Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002,
# 2003, 2004, 2005 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.
srcdir = .
top_srcdir = .
pkgdatadir = $(datadir)/sam7utils
pkglibdir = $(libdir)/sam7utils
pkgincludedir = $(includedir)/sam7utils
top_builddir = .
am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd
INSTALL = /bin/install -c
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 = i686-pc-mingw32
host_triplet = i686-pc-mingw32
target_triplet = i686-pc-mingw32
LIBOBJDIR =
bin_PROGRAMS = sam7$(EXEEXT)
DIST_COMMON = README $(am__configure_deps) $(noinst_HEADERS) \
$(srcdir)/Makefile.am $(srcdir)/Makefile.in \
$(srcdir)/config.h.in $(top_srcdir)/configure AUTHORS COPYING \
ChangeLog INSTALL NEWS config.guess config.sub depcomp \
install-sh missing
subdir = .
ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
am__aclocal_m4_deps = $(top_srcdir)/configure.in
am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
$(ACLOCAL_M4)
am__CONFIG_DISTCLEAN_FILES = config.status config.cache config.log \
configure.lineno configure.status.lineno
mkinstalldirs = $(install_sh) -d
CONFIG_HEADER = config.h
CONFIG_CLEAN_FILES =
am__installdirs = "$(DESTDIR)$(bindir)"
binPROGRAMS_INSTALL = $(INSTALL_PROGRAM)
PROGRAMS = $(bin_PROGRAMS)
am_sam7_OBJECTS = main.$(OBJEXT) io_posix.$(OBJEXT) samba.$(OBJEXT) \
cmd.$(OBJEXT)
sam7_OBJECTS = $(am_sam7_OBJECTS)
sam7_LDADD = $(LDADD)
DEFAULT_INCLUDES = -I. -I$(srcdir) -I.
depcomp = $(SHELL) $(top_srcdir)/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 = $(sam7_SOURCES)
DIST_SOURCES = $(sam7_SOURCES)
HEADERS = $(noinst_HEADERS)
ETAGS = etags
CTAGS = ctags
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
GZIP_ENV = --best
distuninstallcheck_listfiles = find . -type f -print
distcleancheck_listfiles = find . -type f -print
ACLOCAL = aclocal-1.9
AMDEP_FALSE = #
AMDEP_TRUE =
AMTAR = tar
AUTOCONF = autoconf
AUTOHEADER = autoheader
AUTOMAKE = automake-1.9
AWK = gawk
CC = gcc
CCDEPMODE = depmode=gcc3
CFLAGS = -g -O2
CPP = gcc -E
CPPFLAGS =
CYGPATH_W = echo
DEFS = -DHAVE_CONFIG_H
DEPDIR = .deps
ECHO_C =
ECHO_N = -n
ECHO_T =
EGREP = grep -E
EXEEXT = .exe
INSTALL_DATA = ${INSTALL} -m 644
INSTALL_PROGRAM = ${INSTALL}
INSTALL_SCRIPT = ${INSTALL}
INSTALL_STRIP_PROGRAM = ${SHELL} $(install_sh) -c -s
IOTYPE = posix
LDFLAGS =
LIBOBJS =
LIBS = -lreadline -lncurses
LTLIBOBJS =
MAKEINFO = makeinfo
OBJEXT = o
PACKAGE = sam7utils
PACKAGE_BUGREPORT = konkers@konkers.net
PACKAGE_NAME = sam7utils
PACKAGE_STRING = sam7utils 0.1.0
PACKAGE_TARNAME = sam7utils
PACKAGE_VERSION = 0.1.0
PATH_SEPARATOR = :
SET_MAKE =
SHELL = /bin/sh
STRIP =
VERSION = 0.1.0
ac_ct_CC = gcc
ac_ct_STRIP =
am__fastdepCC_FALSE = #
am__fastdepCC_TRUE =
am__include = include
am__leading_dot = .
am__quote =
am__tar = ${AMTAR} chof - "$$tardir"
am__untar = ${AMTAR} xf -
bindir = ${exec_prefix}/bin
build = i686-pc-mingw32
build_alias =
build_cpu = i686
build_os = mingw32
build_vendor = pc
datadir = ${prefix}/share
exec_prefix = ${prefix}
host = i686-pc-mingw32
host_alias =
host_cpu = i686
host_os = mingw32
host_vendor = pc
includedir = ${prefix}/include
infodir = ${prefix}/info
install_sh = /D/Visual Studio 2010/Projects/Matomat/sam7utils/install-sh
libdir = ${exec_prefix}/lib
libexecdir = ${exec_prefix}/libexec
localstatedir = ${prefix}/var
mandir = ${prefix}/man
mkdir_p = mkdir -p --
oldincludedir = /usr/include
prefix = /usr/local
program_transform_name = s,x,x,
sbindir = ${exec_prefix}/sbin
sharedstatedir = ${prefix}/com
sysconfdir = ${prefix}/etc
target = i686-pc-mingw32
target_alias =
target_cpu = i686
target_os = mingw32
target_vendor = pc
AM_CFLAGS = -Wall -Werror
AUTOMAKE_OPTIONS = gnu
sam7_SOURCES = main.c io_posix.c samba.c cmd.c
noinst_HEADERS = io.h samba.h cmd.h loader128_data.h loader256_data.h
EXTRA_DIST = driver/Makefile driver/at91.c io_win32.c io_posix.c io_iokit.c \
loader/Makefile loader/at91.h loader/bin2c.c loader/crt0.S \
loader/loader.c loader/loader.lds
all: config.h
$(MAKE) $(AM_MAKEFLAGS) all-am
.SUFFIXES:
.SUFFIXES: .c .o .obj
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) --gnu '; \
cd $(srcdir) && $(AUTOMAKE) --gnu \
&& exit 0; \
exit 1;; \
esac; \
done; \
echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu Makefile'; \
cd $(top_srcdir) && \
$(AUTOMAKE) --gnu 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) 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
install-binPROGRAMS: $(bin_PROGRAMS)
@$(NORMAL_INSTALL)
test -z "$(bindir)" || $(mkdir_p) "$(DESTDIR)$(bindir)"
@list='$(bin_PROGRAMS)'; for p in $$list; do \
p1=`echo $$p|sed 's/$(EXEEXT)$$//'`; \
if test -f $$p \
; then \
f=`echo "$$p1" | sed 's,^.*/,,;$(transform);s/$$/$(EXEEXT)/'`; \
echo " $(INSTALL_PROGRAM_ENV) $(binPROGRAMS_INSTALL) '$$p' '$(DESTDIR)$(bindir)/$$f'"; \
$(INSTALL_PROGRAM_ENV) $(binPROGRAMS_INSTALL) "$$p" "$(DESTDIR)$(bindir)/$$f" || exit 1; \
else :; fi; \
done
uninstall-binPROGRAMS:
@$(NORMAL_UNINSTALL)
@list='$(bin_PROGRAMS)'; for p in $$list; do \
f=`echo "$$p" | sed 's,^.*/,,;s/$(EXEEXT)$$//;$(transform);s/$$/$(EXEEXT)/'`; \
echo " rm -f '$(DESTDIR)$(bindir)/$$f'"; \
rm -f "$(DESTDIR)$(bindir)/$$f"; \
done
clean-binPROGRAMS:
-test -z "$(bin_PROGRAMS)" || rm -f $(bin_PROGRAMS)
sam7$(EXEEXT): $(sam7_OBJECTS) $(sam7_DEPENDENCIES)
@rm -f sam7$(EXEEXT)
$(LINK) $(sam7_LDFLAGS) $(sam7_OBJECTS) $(sam7_LDADD) $(LIBS)
mostlyclean-compile:
-rm -f *.$(OBJEXT)
distclean-compile:
-rm -f *.tab.c
include ./$(DEPDIR)/cmd.Po
include ./$(DEPDIR)/io_posix.Po
include ./$(DEPDIR)/main.Po
include ./$(DEPDIR)/samba.Po
.c.o:
if $(COMPILE) -MT $@ -MD -MP -MF "$(DEPDIR)/$*.Tpo" -c -o $@ $<; \
then mv -f "$(DEPDIR)/$*.Tpo" "$(DEPDIR)/$*.Po"; else rm -f "$(DEPDIR)/$*.Tpo"; exit 1; fi
# source='$<' object='$@' libtool=no \
# DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) \
# $(COMPILE) -c $<
.c.obj:
if $(COMPILE) -MT $@ -MD -MP -MF "$(DEPDIR)/$*.Tpo" -c -o $@ `$(CYGPATH_W) '$<'`; \
then mv -f "$(DEPDIR)/$*.Tpo" "$(DEPDIR)/$*.Po"; else rm -f "$(DEPDIR)/$*.Tpo"; exit 1; fi
# source='$<' object='$@' libtool=no \
# DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) \
# $(COMPILE) -c `$(CYGPATH_W) '$<'`
uninstall-info-am:
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) 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; }'`; \
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) 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)
mkdir $(distdir)
$(mkdir_p) $(distdir)/driver $(distdir)/loader
@srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`; \
topsrcdirstrip=`echo "$(top_srcdir)" | sed 's|.|.|g'`; \
list='$(DISTFILES)'; for file in $$list; do \
case $$file in \
$(srcdir)/*) file=`echo "$$file" | sed "s|^$$srcdirstrip/||"`;; \
$(top_srcdir)/*) file=`echo "$$file" | sed "s|^$$topsrcdirstrip/|$(top_builddir)/|"`;; \
esac; \
if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \
dir=`echo "$$file" | sed -e 's,/[^/]*$$,,'`; \
if test "$$dir" != "$$file" && test "$$dir" != "."; then \
dir="/$$dir"; \
$(mkdir_p) "$(distdir)$$dir"; \
else \
dir=''; \
fi; \
if test -d $$d/$$file; then \
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
-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 $(SHELL) $(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
$(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 '1{h;s/./=/g;p;x;}' -e '$${p;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-am
all-am: Makefile $(PROGRAMS) $(HEADERS) config.h
installdirs:
for dir in "$(DESTDIR)$(bindir)"; do \
test -z "$$dir" || $(mkdir_p) "$$dir"; \
done
install: install-am
install-exec: install-exec-am
install-data: install-data-am
uninstall: uninstall-am
install-am: all-am
@$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am
installcheck: installcheck-am
install-strip:
$(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \
install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \
`test -z '$(STRIP)' || \
echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install
mostlyclean-generic:
clean-generic:
distclean-generic:
-test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES)
maintainer-clean-generic:
@echo "This command is intended for maintainers to use"
@echo "it deletes files that may require special tools to rebuild."
clean: clean-am
clean-am: clean-binPROGRAMS clean-generic mostlyclean-am
distclean: distclean-am
-rm -f $(am__CONFIG_DISTCLEAN_FILES)
-rm -rf ./$(DEPDIR)
-rm -f Makefile
distclean-am: clean-am distclean-compile distclean-generic \
distclean-hdr distclean-tags
dvi: dvi-am
dvi-am:
html: html-am
info: info-am
info-am:
install-data-am:
install-exec-am: install-binPROGRAMS
install-info: install-info-am
install-man:
installcheck-am:
maintainer-clean: maintainer-clean-am
-rm -f $(am__CONFIG_DISTCLEAN_FILES)
-rm -rf $(top_srcdir)/autom4te.cache
-rm -rf ./$(DEPDIR)
-rm -f Makefile
maintainer-clean-am: distclean-am maintainer-clean-generic
mostlyclean: mostlyclean-am
mostlyclean-am: mostlyclean-compile mostlyclean-generic
pdf: pdf-am
pdf-am:
ps: ps-am
ps-am:
uninstall-am: uninstall-binPROGRAMS uninstall-info-am
.PHONY: CTAGS GTAGS all all-am am--refresh check check-am clean \
clean-binPROGRAMS clean-generic ctags dist dist-all dist-bzip2 \
dist-gzip dist-shar dist-tarZ dist-zip distcheck distclean \
distclean-compile distclean-generic distclean-hdr \
distclean-tags distcleancheck distdir distuninstallcheck dvi \
dvi-am html html-am info info-am install install-am \
install-binPROGRAMS install-data install-data-am install-exec \
install-exec-am install-info install-info-am install-man \
install-strip installcheck installcheck-am installdirs \
maintainer-clean maintainer-clean-generic mostlyclean \
mostlyclean-compile mostlyclean-generic pdf pdf-am ps ps-am \
tags uninstall uninstall-am uninstall-binPROGRAMS \
uninstall-info-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:
+12
View File
@@ -0,0 +1,12 @@
AM_CFLAGS = -Wall -Werror
AUTOMAKE_OPTIONS = gnu
bin_PROGRAMS = sam7
sam7_SOURCES = main.c io_@IOTYPE@.c samba.c cmd.c
noinst_HEADERS = io.h samba.h cmd.h loader128_data.h loader256_data.h
EXTRA_DIST = driver/Makefile driver/at91.c io_win32.c io_posix.c io_iokit.c \
loader/Makefile loader/at91.h loader/bin2c.c loader/crt0.S \
loader/loader.c loader/loader.lds
+562
View File
@@ -0,0 +1,562 @@
# Makefile.in generated by automake 1.9.6 from Makefile.am.
# @configure_input@
# Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002,
# 2003, 2004, 2005 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@
srcdir = @srcdir@
top_srcdir = @top_srcdir@
VPATH = @srcdir@
pkgdatadir = $(datadir)/@PACKAGE@
pkglibdir = $(libdir)/@PACKAGE@
pkgincludedir = $(includedir)/@PACKAGE@
top_builddir = .
am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd
INSTALL = @INSTALL@
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@
LIBOBJDIR =
bin_PROGRAMS = sam7$(EXEEXT)
DIST_COMMON = README $(am__configure_deps) $(noinst_HEADERS) \
$(srcdir)/Makefile.am $(srcdir)/Makefile.in \
$(srcdir)/config.h.in $(top_srcdir)/configure AUTHORS COPYING \
ChangeLog INSTALL NEWS config.guess config.sub depcomp \
install-sh missing
subdir = .
ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
am__aclocal_m4_deps = $(top_srcdir)/configure.in
am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
$(ACLOCAL_M4)
am__CONFIG_DISTCLEAN_FILES = config.status config.cache config.log \
configure.lineno configure.status.lineno
mkinstalldirs = $(install_sh) -d
CONFIG_HEADER = config.h
CONFIG_CLEAN_FILES =
am__installdirs = "$(DESTDIR)$(bindir)"
binPROGRAMS_INSTALL = $(INSTALL_PROGRAM)
PROGRAMS = $(bin_PROGRAMS)
am_sam7_OBJECTS = main.$(OBJEXT) io_@IOTYPE@.$(OBJEXT) samba.$(OBJEXT) \
cmd.$(OBJEXT)
sam7_OBJECTS = $(am_sam7_OBJECTS)
sam7_LDADD = $(LDADD)
DEFAULT_INCLUDES = -I. -I$(srcdir) -I.
depcomp = $(SHELL) $(top_srcdir)/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 = $(sam7_SOURCES)
DIST_SOURCES = $(sam7_SOURCES)
HEADERS = $(noinst_HEADERS)
ETAGS = etags
CTAGS = ctags
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
GZIP_ENV = --best
distuninstallcheck_listfiles = find . -type f -print
distcleancheck_listfiles = find . -type f -print
ACLOCAL = @ACLOCAL@
AMDEP_FALSE = @AMDEP_FALSE@
AMDEP_TRUE = @AMDEP_TRUE@
AMTAR = @AMTAR@
AUTOCONF = @AUTOCONF@
AUTOHEADER = @AUTOHEADER@
AUTOMAKE = @AUTOMAKE@
AWK = @AWK@
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@
INSTALL_DATA = @INSTALL_DATA@
INSTALL_PROGRAM = @INSTALL_PROGRAM@
INSTALL_SCRIPT = @INSTALL_SCRIPT@
INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@
IOTYPE = @IOTYPE@
LDFLAGS = @LDFLAGS@
LIBOBJS = @LIBOBJS@
LIBS = @LIBS@
LTLIBOBJS = @LTLIBOBJS@
MAKEINFO = @MAKEINFO@
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@
SET_MAKE = @SET_MAKE@
SHELL = @SHELL@
STRIP = @STRIP@
VERSION = @VERSION@
ac_ct_CC = @ac_ct_CC@
ac_ct_STRIP = @ac_ct_STRIP@
am__fastdepCC_FALSE = @am__fastdepCC_FALSE@
am__fastdepCC_TRUE = @am__fastdepCC_TRUE@
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@
datadir = @datadir@
exec_prefix = @exec_prefix@
host = @host@
host_alias = @host_alias@
host_cpu = @host_cpu@
host_os = @host_os@
host_vendor = @host_vendor@
includedir = @includedir@
infodir = @infodir@
install_sh = @install_sh@
libdir = @libdir@
libexecdir = @libexecdir@
localstatedir = @localstatedir@
mandir = @mandir@
mkdir_p = @mkdir_p@
oldincludedir = @oldincludedir@
prefix = @prefix@
program_transform_name = @program_transform_name@
sbindir = @sbindir@
sharedstatedir = @sharedstatedir@
sysconfdir = @sysconfdir@
target = @target@
target_alias = @target_alias@
target_cpu = @target_cpu@
target_os = @target_os@
target_vendor = @target_vendor@
AM_CFLAGS = -Wall -Werror
AUTOMAKE_OPTIONS = gnu
sam7_SOURCES = main.c io_@IOTYPE@.c samba.c cmd.c
noinst_HEADERS = io.h samba.h cmd.h loader128_data.h loader256_data.h
EXTRA_DIST = driver/Makefile driver/at91.c io_win32.c io_posix.c io_iokit.c \
loader/Makefile loader/at91.h loader/bin2c.c loader/crt0.S \
loader/loader.c loader/loader.lds
all: config.h
$(MAKE) $(AM_MAKEFLAGS) all-am
.SUFFIXES:
.SUFFIXES: .c .o .obj
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) --gnu '; \
cd $(srcdir) && $(AUTOMAKE) --gnu \
&& exit 0; \
exit 1;; \
esac; \
done; \
echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu Makefile'; \
cd $(top_srcdir) && \
$(AUTOMAKE) --gnu 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) 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
install-binPROGRAMS: $(bin_PROGRAMS)
@$(NORMAL_INSTALL)
test -z "$(bindir)" || $(mkdir_p) "$(DESTDIR)$(bindir)"
@list='$(bin_PROGRAMS)'; for p in $$list; do \
p1=`echo $$p|sed 's/$(EXEEXT)$$//'`; \
if test -f $$p \
; then \
f=`echo "$$p1" | sed 's,^.*/,,;$(transform);s/$$/$(EXEEXT)/'`; \
echo " $(INSTALL_PROGRAM_ENV) $(binPROGRAMS_INSTALL) '$$p' '$(DESTDIR)$(bindir)/$$f'"; \
$(INSTALL_PROGRAM_ENV) $(binPROGRAMS_INSTALL) "$$p" "$(DESTDIR)$(bindir)/$$f" || exit 1; \
else :; fi; \
done
uninstall-binPROGRAMS:
@$(NORMAL_UNINSTALL)
@list='$(bin_PROGRAMS)'; for p in $$list; do \
f=`echo "$$p" | sed 's,^.*/,,;s/$(EXEEXT)$$//;$(transform);s/$$/$(EXEEXT)/'`; \
echo " rm -f '$(DESTDIR)$(bindir)/$$f'"; \
rm -f "$(DESTDIR)$(bindir)/$$f"; \
done
clean-binPROGRAMS:
-test -z "$(bin_PROGRAMS)" || rm -f $(bin_PROGRAMS)
sam7$(EXEEXT): $(sam7_OBJECTS) $(sam7_DEPENDENCIES)
@rm -f sam7$(EXEEXT)
$(LINK) $(sam7_LDFLAGS) $(sam7_OBJECTS) $(sam7_LDADD) $(LIBS)
mostlyclean-compile:
-rm -f *.$(OBJEXT)
distclean-compile:
-rm -f *.tab.c
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/cmd.Po@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/io_@IOTYPE@.Po@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/main.Po@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/samba.Po@am__quote@
.c.o:
@am__fastdepCC_TRUE@ if $(COMPILE) -MT $@ -MD -MP -MF "$(DEPDIR)/$*.Tpo" -c -o $@ $<; \
@am__fastdepCC_TRUE@ then mv -f "$(DEPDIR)/$*.Tpo" "$(DEPDIR)/$*.Po"; else rm -f "$(DEPDIR)/$*.Tpo"; exit 1; fi
@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@ if $(COMPILE) -MT $@ -MD -MP -MF "$(DEPDIR)/$*.Tpo" -c -o $@ `$(CYGPATH_W) '$<'`; \
@am__fastdepCC_TRUE@ then mv -f "$(DEPDIR)/$*.Tpo" "$(DEPDIR)/$*.Po"; else rm -f "$(DEPDIR)/$*.Tpo"; exit 1; fi
@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) '$<'`
uninstall-info-am:
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) 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; }'`; \
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) 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)
mkdir $(distdir)
$(mkdir_p) $(distdir)/driver $(distdir)/loader
@srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`; \
topsrcdirstrip=`echo "$(top_srcdir)" | sed 's|.|.|g'`; \
list='$(DISTFILES)'; for file in $$list; do \
case $$file in \
$(srcdir)/*) file=`echo "$$file" | sed "s|^$$srcdirstrip/||"`;; \
$(top_srcdir)/*) file=`echo "$$file" | sed "s|^$$topsrcdirstrip/|$(top_builddir)/|"`;; \
esac; \
if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \
dir=`echo "$$file" | sed -e 's,/[^/]*$$,,'`; \
if test "$$dir" != "$$file" && test "$$dir" != "."; then \
dir="/$$dir"; \
$(mkdir_p) "$(distdir)$$dir"; \
else \
dir=''; \
fi; \
if test -d $$d/$$file; then \
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
-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 $(SHELL) $(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
$(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 '1{h;s/./=/g;p;x;}' -e '$${p;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-am
all-am: Makefile $(PROGRAMS) $(HEADERS) config.h
installdirs:
for dir in "$(DESTDIR)$(bindir)"; do \
test -z "$$dir" || $(mkdir_p) "$$dir"; \
done
install: install-am
install-exec: install-exec-am
install-data: install-data-am
uninstall: uninstall-am
install-am: all-am
@$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am
installcheck: installcheck-am
install-strip:
$(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \
install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \
`test -z '$(STRIP)' || \
echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install
mostlyclean-generic:
clean-generic:
distclean-generic:
-test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES)
maintainer-clean-generic:
@echo "This command is intended for maintainers to use"
@echo "it deletes files that may require special tools to rebuild."
clean: clean-am
clean-am: clean-binPROGRAMS clean-generic mostlyclean-am
distclean: distclean-am
-rm -f $(am__CONFIG_DISTCLEAN_FILES)
-rm -rf ./$(DEPDIR)
-rm -f Makefile
distclean-am: clean-am distclean-compile distclean-generic \
distclean-hdr distclean-tags
dvi: dvi-am
dvi-am:
html: html-am
info: info-am
info-am:
install-data-am:
install-exec-am: install-binPROGRAMS
install-info: install-info-am
install-man:
installcheck-am:
maintainer-clean: maintainer-clean-am
-rm -f $(am__CONFIG_DISTCLEAN_FILES)
-rm -rf $(top_srcdir)/autom4te.cache
-rm -rf ./$(DEPDIR)
-rm -f Makefile
maintainer-clean-am: distclean-am maintainer-clean-generic
mostlyclean: mostlyclean-am
mostlyclean-am: mostlyclean-compile mostlyclean-generic
pdf: pdf-am
pdf-am:
ps: ps-am
ps-am:
uninstall-am: uninstall-binPROGRAMS uninstall-info-am
.PHONY: CTAGS GTAGS all all-am am--refresh check check-am clean \
clean-binPROGRAMS clean-generic ctags dist dist-all dist-bzip2 \
dist-gzip dist-shar dist-tarZ dist-zip distcheck distclean \
distclean-compile distclean-generic distclean-hdr \
distclean-tags distcleancheck distdir distuninstallcheck dvi \
dvi-am html html-am info info-am install install-am \
install-binPROGRAMS install-data install-data-am install-exec \
install-exec-am install-info install-info-am install-man \
install-strip installcheck installcheck-am installdirs \
maintainer-clean maintainer-clean-generic mostlyclean \
mostlyclean-compile mostlyclean-generic pdf pdf-am ps ps-am \
tags uninstall uninstall-am uninstall-binPROGRAMS \
uninstall-info-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:
View File
+42
View File
@@ -0,0 +1,42 @@
AT91SAM7 USB specific firmware flash approach
Milosch Meriac <meriac@bitmanufaktur.de>
sam7utils: (C) 2006 Erik Gilling
To make sure that the SAM7 interface will be recognized
by the Linux Kernel please add the following line to
/etc/modprobe.conf.local (or /etc/modprobe.conf if this
file doesnt exist):
options usbserial vendor=0x03EB product=0x6124
(Re)Plug your device to make sure it will be detected properly.
Find out which serial port its connected to (see last line
- it's ttyUSB2 in this particular case):
dmesg | grep ttyUSB
usb 3-1: pl2303 converter now attached to ttyUSB0
usb 5-2: FTDI USB Serial Device converter now attached to ttyUSB1
usb 1-7.2: generic converter now attached to ttyUSB2
Install the latest firmware image:
sam7 -l /dev/ttyUSB2
Chip Version: 0
Embedded Processor: ARM7TDMI
NVRAM Region 1 Size: 128 K
NVRAM Region 2 Size: 0 K
SRAM Size: 128 K
Series: AT91SAM7Sxx
Page Size: 256 bytes
Lock Regions: 8
sam7> set_clock
sam7> unlock_regions
unlocking region 0: done
unlocking region 1: done
sam7> flash myfirmware.img
+19
View File
@@ -0,0 +1,19 @@
If you are running linux, you first need to load the at91 kernel driver:
> insmod driver/at91.ko
Once that's loaded (or you are using OSX):
> ./sam7
response = 0d0a
it begins
sam7> set_clock
sam7> unlock_regions
unlocking page 0: done
unlocking page 1: done
sam7> manual_flash test.bin
>
+862
View File
@@ -0,0 +1,862 @@
# generated automatically by aclocal 1.9.6 -*- Autoconf -*-
# Copyright (C) 1996, 1997, 1998, 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.
# 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.
# Copyright (C) 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.
# 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.
AC_DEFUN([AM_AUTOMAKE_VERSION], [am__api_version="1.9"])
# AM_SET_CURRENT_AUTOMAKE_VERSION
# -------------------------------
# Call AM_AUTOMAKE_VERSION so it can be traced.
# This function is AC_REQUIREd by AC_INIT_AUTOMAKE.
AC_DEFUN([AM_SET_CURRENT_AUTOMAKE_VERSION],
[AM_AUTOMAKE_VERSION([1.9.6])])
# 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
# 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 7
# 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])
AC_SUBST([$1_FALSE])
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
# 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
# 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], 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/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])
])
# 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.
# So let's grep whole file.
if grep '^#.*generated by automake' $mf > /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"])
])
# 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 8
# AM_CONFIG_HEADER is obsolete. It has been replaced by AC_CONFIG_HEADERS.
AU_DEFUN([AM_CONFIG_HEADER], [AC_CONFIG_HEADERS($@)])
# Do all the work for Automake. -*- Autoconf -*-
# Copyright (C) 1996, 1997, 1998, 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 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.58])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
# test to see if srcdir already configured
if test "`cd $srcdir && pwd`" != "`pwd`" &&
test -f $srcdir/config.status; then
AC_MSG_ERROR([source directory already configured; run "make distclean" there first])
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
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
])
])
# 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-"$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
])
# Fake the existence of programs that GNU maintainers use. -*- Autoconf -*-
# Copyright (C) 1997, 1999, 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_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
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 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 whether `mkdir -p' is supported, fallback to mkinstalldirs otherwise.
#
# Automake 1.8 used `mkdir -m 0755 -p --' to ensure that directories
# created by `make install' are always world readable, even if the
# installer happens to have an overly restrictive umask (e.g. 077).
# This was a mistake. There are at least two reasons why we must not
# use `-m 0755':
# - it causes special bits like SGID to be ignored,
# - it may be too restrictive (some setups expect 775 directories).
#
# Do not use -m 0755 and let people choose whatever they expect by
# setting umask.
#
# We cannot accept any implementation of `mkdir' that recognizes `-p'.
# Some implementations (such as Solaris 8's) are not thread-safe: if a
# parallel make tries to run `mkdir -p a/b' and `mkdir -p a/c'
# concurrently, both version can detect that a/ is missing, but only
# one can create it and the other will error out. Consequently we
# restrict ourselves to GNU make (using the --version option ensures
# this.)
AC_DEFUN([AM_PROG_MKDIR_P],
[if mkdir -p --version . >/dev/null 2>&1 && test ! -d ./--version; then
# We used to keeping the `.' as first argument, in order to
# allow $(mkdir_p) to be used without argument. As in
# $(mkdir_p) $(somedir)
# where $(somedir) is conditionally defined. However this is wrong
# for two reasons:
# 1. if the package is installed by a user who cannot write `.'
# make install will fail,
# 2. the above comment should most certainly read
# $(mkdir_p) $(DESTDIR)$(somedir)
# so it does not work when $(somedir) is undefined and
# $(DESTDIR) is not.
# To support the latter case, we have to write
# test -z "$(somedir)" || $(mkdir_p) $(DESTDIR)$(somedir),
# so the `.' trick is pointless.
mkdir_p='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.
for d in ./-p ./--version;
do
test -d $d && rmdir $d
done
# $(mkinstalldirs) is defined by Automake if mkinstalldirs exists.
if test -f "$ac_aux_dir/mkinstalldirs"; then
mkdir_p='$(mkinstalldirs)'
else
mkdir_p='$(install_sh) -d'
fi
fi
AC_SUBST([mkdir_p])])
# 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="\${SHELL} \$(install_sh) -c -s"
AC_SUBST([INSTALL_STRIP_PROGRAM])])
# 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
+26
View File
@@ -0,0 +1,26 @@
#!/bin/bash
# (C) Milosch Meriac <meriac@bitmanufaktur.de> 2006
UART='/dev/ttyUSB1'
SAM7='/usr/local/bin/sam7'
if [[ -a $1 ]]; then
echo "1. please unplug the USB cable and insert the SAM-BA jumper (Pin 1+2)"
echo "2. attach the USB cable"
echo "3. wait ten seconds"
echo "4. unplug the USB cable"
echo "5. remove the SAM-BA jumper"
echo "6. attach the USB cable"
echo "7. wait several seconds to allow the device to be detected by Linux"
echo "8. press [ENTER] to start flashing"
echo -e "9. flashing '$1'...\n"
$SAM7 << ENDOFMYTEXT
set_clock
unlock_regions
flash $1
ENDOFMYTEXT
echo '10. done!'
else
echo "can't open flash image file '$1'"
+682
View File
@@ -0,0 +1,682 @@
/*
* cmd.c
*
* Copyright (C) 2005 Erik Gilling, all rights reserved.
*
* 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, version 2.
*
*/
#include "config.h"
#include <sys/types.h>
#include <sys/stat.h>
#include <fcntl.h>
#include <unistd.h>
#include <stdlib.h>
#include <stdio.h>
#include <string.h>
#include <errno.h>
#include "samba.h"
#include "cmd.h"
#include "loader128_data.h"
#include "loader256_data.h"
#define MANUAL_FLASH
static int cmd_help( int argc, char *argv[] );
static int cmd_version( int argc, char *argv[] );
static int cmd_write_mem( int argc, char *argv[] );
static int cmd_read_mem( int argc, char *argv[] );
static int cmd_send_file( int argc, char *argv[] );
static int cmd_set_clock( int argc, char *argv[] );
static int cmd_locked_regions( int argc, char *argv[] );
static int cmd_unlock_regions( int argc, char *argv[] );
static int cmd_boot_from_flash( int argc, char *argv[] );
static int cmd_flash( int argc, char *argv[] );
static int cmd_read( int argc, char *argv[] );
static int cmd_manual_flash( int argc, char *argv[] );
static int cmd_manual_read( int argc, char *argv[] );
static cmd_t cmds[] = {
{cmd_write_mem, "wb",
"wb <addr> <byte>", "write <byte> to <addr>"},
{cmd_read_mem, "rb",
"rb <addr>", "read byte from <addr>"},
{cmd_write_mem, "ws",
"ws <addr> <short>", "write <short> to <addr>"},
{cmd_read_mem, "rs",
"rs <addr>", "read short from <addr>"},
{cmd_write_mem, "ww",
"ww <addr> <word>", "write <word> to <addr>"},
{cmd_read_mem, "rw",
"rw <addr>", "read word from <addr>"},
{cmd_send_file, "sf",
"sf <addr> <file> <offset> <len>",
"send len bytes of file starting at offset"},
{cmd_set_clock, "set_clock",
"set_clock", "set clock as SAM-BA does"},
{cmd_locked_regions, "locked_regions",
"locked_regions", "display locked regions"},
{cmd_unlock_regions, "unlock_regions",
"unlock_regions", "unlock all lock regions"},
{cmd_boot_from_flash, "boot_from_flash",
"boot_from_flash", "et the SAM7X to boot from flashs"},
{cmd_flash, "flash",
"flash <file>", "upload <file> to flash using samba.bin"},
{cmd_read, "read",
"read <file> <addr> <len>", "write <len> bytes at <addr> to <file> using R commands"},
{cmd_manual_flash, "manual_flash",
"manual_flash <file>", "upload <file> to flash using ww commands"},
{cmd_manual_read, "manual_read",
"manual_read <file> <addr> <len>", "write <len> bytes at <addr> to <file> using rw commands"},
{cmd_version, "version",
"version", "get boot program version"},
{cmd_help, "help",
"help", "display help screen"}
};
cmd_t *cmd_find( char *name )
{
int i;
for( i=0 ; i<(sizeof(cmds)/
sizeof(*cmds)); i++ ) {
if( !strcmp( name, cmds[i].name ) ) {
return &cmds[i];
}
}
return NULL;
}
static int cmd_help( int argc, char *argv[] )
{
int i;
for( i=0 ; i<(sizeof(cmds)/
sizeof(*cmds)); i++ ) {
printf( "%-30s%s\n", cmds[i].invo, cmds[i].help );
}
return 0;
}
static int cmd_write_mem( int argc, char *argv[] )
{
unsigned long int addr;
unsigned long int val;
char *endp;
if( argc != 3 ) {
return CMD_E_WRONG_NUM_ARGS;
}
addr = strtoul( argv[1], &endp, 0 );
if( endp == argv[1] ||
*endp != '\0' ) {
return CMD_E_INVAL_ARG;
}
val = strtoul( argv[2], &endp, 0 );
if( endp == argv[1] ||
*endp != '\0' ) {
return CMD_E_INVAL_ARG;
}
switch( argv[0][1] ) {
case 'b':
if( samba_write_byte( addr, (uint8_t) val ) < 0 ) {
return CMD_E_IO_FAILURE;
}
break;
case 's':
if( samba_write_half_word( addr, (uint16_t) val ) < 0 ) {
return CMD_E_IO_FAILURE;
}
break;
case 'w':
if( samba_write_word( addr, (uint32_t) val ) < 0 ) {
return CMD_E_IO_FAILURE;
}
break;
}
return CMD_E_OK;
}
static int cmd_read_mem( int argc, char *argv[] )
{
unsigned long int addr;
char *endp;
if( argc != 2 ) {
return CMD_E_WRONG_NUM_ARGS;
}
addr = strtoul( argv[1], &endp, 0 );
if( endp == argv[1] ||
*endp != '\0' ) {
return CMD_E_INVAL_ARG;
}
switch( argv[0][1] ) {
case 'b':
{
uint8_t val;
if( samba_read_byte( addr, &val ) < 0 ) {
return CMD_E_IO_FAILURE;
}
printf( "%02X\n", val );
}
break;
case 's':
{
uint16_t val;
if( samba_read_half_word( addr, &val ) < 0 ) {
return CMD_E_IO_FAILURE;
}
printf( "%04X\n", val );
}
break;
case 'w':
{
uint32_t val;
if( samba_read_word( addr, &val ) < 0 ) {
return CMD_E_IO_FAILURE;
}
printf( "%08X\n", (unsigned int) val );
}
break;
}
return CMD_E_OK;
}
static int cmd_send_file( int argc, char *argv[] )
{
unsigned long int offset;
unsigned long int len;
unsigned long int addr;
char *endp;
uint8_t *data;
int fd;
if( argc != 5 ) {
return CMD_E_WRONG_NUM_ARGS;
}
addr = strtoul( argv[1], &endp, 0 );
if( endp == argv[1] ||
*endp != '\0' ) {
return CMD_E_INVAL_ARG;
}
offset = strtoul( argv[3], &endp, 0 );
if( endp == argv[1] ||
*endp != '\0' ) {
return CMD_E_INVAL_ARG;
}
len = strtoul( argv[4], &endp, 0 );
if( endp == argv[1] ||
*endp != '\0' ) {
return CMD_E_INVAL_ARG;
}
if( (data = (uint8_t *) malloc( len )) == NULL ) {
printf( "can't allocate %d bytes\n", (int)len );
return CMD_E_NO_MEM;
}
if( (fd = open( argv[2], O_RDONLY )) < 0 ) {
printf( "can't open file \"%s\": %s\n", argv[2],
strerror( errno ) );
return CMD_E_BAD_FILE;
}
lseek( fd, offset, SEEK_SET );
len = read( fd, data, len );
if( samba_send_file( 0x202000, data, len ) < 0 ) {
return CMD_E_IO_FAILURE;
}
return CMD_E_OK;
}
static int cmd_version( int argc, char *argv[] )
{
char buff[256];
if( samba_get_version( buff, 256 ) < 0 ) {
return CMD_E_IO_FAILURE;
}
printf( "%s\n", buff );
return CMD_E_OK;
}
static int cmd_set_clock( int argc, char *argv[] )
{
uint32_t val;
uint8_t val8;
/* set clock to main clock / 2 */
if( samba_write_word( 0xFFFFFC30, 0x5 ) < 0 ) {
return -1;
}
do {
if( samba_read_word( 0xFFFFFC68, &val ) < 0 ) {
return -1;
}
} while( val != 0xD );
/* set clock to pll clock / 2 */
if( samba_write_word( 0xFFFFFC30, 0x7 ) < 0 ) {
return -1;
}
do {
if( samba_read_word( 0xFFFFFC68, &val ) < 0 ) {
return -1;
}
} while( val != 0xD );
/* read 0x200000 two times because SAM-BA does it */
if( samba_read_byte( 0x00200000, &val8 ) < 0 ) {
return -1;
}
if( val8 != 0x13 ) {
printf( "warning: magic read 0x00200000 != 0x13\n" );
}
if( samba_read_byte( 0x00200000, &val8 ) < 0 ) {
return -1;
}
if( val8 != 0x13 ) {
printf( "warning: magic read 0x00200000 != 0x13\n" );
}
return 0;
}
static int cmd_locked_regions( int argc, char *argv[] )
{
uint32_t val;
int i;
if( samba_read_word( 0xffffff68, &val ) < 0 ) {
return -1;
}
printf( "Locked Regions:" );
for( i=0 ; i<16 ; i++ ) {
if( val & 0x00010000 ) {
printf( " %i", i );
}
val >>= 1;
}
printf( "\n" );
return 0;
}
static int cmd_unlock_regions( int argc, char *argv[] )
{
uint32_t val;
int i;
if( samba_read_word( 0xffffff68, &val ) < 0 ) {
return -1;
}
if( val & 0xffff0000 ) {
/* set up MCLKS to some odd value... hey SAM-BA does it */
if( samba_write_word( 0xffffff60, 0x00050100 ) < 0 ) {
return -1;
}
for( i=0 ; i<16 ; i++ ) {
if( val & 0x00010000 ) {
int page = (samba_chip_info.nvpsiz / samba_chip_info.page_size /
samba_chip_info.lock_bits) * i;
printf( "unlocking region %i:", i );
if( samba_write_word( 0xffffff64,
0x5a000004 | (page << 8) ) < 0 ) {
return -1;
}
printf( " done\n" );
}
val >>= 1;
}
/* set up MCLKS back to a sane value */
if( samba_write_word( 0xffffff60, 0x00480100 ) < 0 ) {
return -1;
}
}
printf( "\n" );
return 0;
}
/* contributed by Liam Staskawicz */
static int cmd_boot_from_flash( int argc, char *argv[] )
{
/*
* word: 5A is key to send any message,
* 02 is GPNVM2 to boot from Flash,
* 0B is "set this bit"
*/
uint32_t val;
do {
if( samba_read_word( 0xffffff68, &val ) < 0 ) {
return -1;
}
} while( !val & 0x1 );
if( samba_write_word( 0xFFFFFF64, 0x5A00020B ) < 0 ) {
printf( "Couldn't flip the bit to boot from Flash.\n" );
return -1;
}
return 0;
}
static int cmd_flash( int argc, char *argv[] )
{
struct stat stbuf;
size_t loader_len;
size_t file_len;
size_t i;
uint8_t *buff;
int file_fd;
int read_len;
int ps = samba_chip_info.page_size;
uint8_t *loader_data;
if( argc != 2 ) {
return CMD_E_WRONG_NUM_ARGS;
}
if( ps == 128 ) {
loader_data = loader128_data;
loader_len = sizeof( loader128_data );
} else if( ps == 256 ) {
loader_data = loader256_data;
loader_len = sizeof( loader256_data );
} else {
printf( "no loader for %d byte pages\n", ps );
return -1;
}
if( stat( argv[1], &stbuf ) < 0 ) {
printf( "%s not found\n", argv[1] );
return -1;
}
file_len = stbuf.st_size;
if( (buff = (uint8_t *) malloc( ps ) ) == NULL ) {
printf( "can't alocate buffer of size 0x%x\n", ps );
goto error0;
}
if( samba_send_file( 0x00201600, loader_data, loader_len ) < 0 ) {
printf( "could not upload samba.bin\n" );
goto error1;
}
if( (file_fd = open( argv[1], O_RDONLY )) < 0 ) {
printf( "can't open %s\n", argv[1] );
return -1;
}
for( i=0 ; i<file_len ; i+=ps ) {
/* set page # */
if( samba_write_word( 0x00201400+ps, i/ps ) < 0 ) {
printf( "could not write page %d address\n", (int) i/ps );
goto error2;
}
read_len = (file_len-i < ps)?file_len-i:ps;
/* XXX need to implement safe read */
if( read( file_fd, buff, read_len ) < read_len ) {
printf( "could not read 0x%x bytes from file\n", read_len );
goto error2;
}
if( samba_send_file( 0x00201400, buff, ps ) < 0 ) {
printf( "could not send page %d\n", (int) i/ps );
goto error2;
}
if( samba_go( 0x00201600 ) < 0 ) {
printf( "could not send go command for page %d\n", (int) i/ps );
goto error2;
}
}
free( buff );
close( file_fd );
return 0;
error2:
close( file_fd );
error1:
free( buff );
error0:
return -1;
}
static int cmd_manual_flash( int argc, char *argv[] )
{
struct stat stbuf;
size_t file_len;
size_t i,j;
char *buff;
int file_fd;
int read_len;
uint32_t val;
int ps = samba_chip_info.page_size;
if( argc != 2 ) {
return CMD_E_WRONG_NUM_ARGS;
}
if( stat( argv[1], &stbuf ) < 0 ) {
printf( "%s not found\n", argv[1] );
return -1;
}
file_len = stbuf.st_size;
if( (buff = (char *) malloc( ps )) == NULL ) {
printf( "can't alocate buffer of size 128\n" );
return -1;
}
if( (file_fd = open( argv[1], O_RDONLY )) < 0 ) {
printf( "can't open %s\n", argv[1] );
goto error0;
}
for( i=0 ; i<file_len ; i+=ps ) {
/* wait for flash to become ready */
do {
if( samba_read_word( 0xffffff68, &val ) < 0 ) {
goto error1;
}
} while( !val & 0x1 );
read_len = (file_len-i < ps)?file_len-i:ps;
/* XXX need to implement safe read */
if( read( file_fd, buff, read_len ) < read_len ) {
printf( "could not read 0x%x bytes from file\n", read_len );
goto error1;
}
for( j=0 ; j<ps ; j+=4 ) {
if( samba_write_word( 0x00100000 + i + j, *((uint32_t*)(buff+j))) < 0 ) {
printf( "could not write byte 0x%x\n", (unsigned int)( 0x00100000 + i + j) );
}
}
/* send write command */
if( samba_write_word( 0xFFFFFF64, 0x5A000001 | ((i/ps) << 8) ) < 0 ) {
printf( "could not send write command for page %d\n", (int) i/ps );
goto error1;
}
}
free( buff );
close( file_fd );
return 0;
error1:
close( file_fd );
error0:
free( buff );
return -1;
}
static int cmd_manual_read( int argc, char *argv[] )
{
unsigned long int addr;
unsigned long int len;
int fd;
int i;
uint32_t val;
char *endp;
if( argc != 4 ) {
printf( "wrong number of args\n" );
return CMD_E_WRONG_NUM_ARGS;
}
addr = strtoul( argv[2], &endp, 0 );
if( endp == argv[2] ||
*endp != '\0' ) {
printf("%s not a vaild number\n", argv[2]);
return CMD_E_INVAL_ARG;
}
len = strtoul( argv[3], &endp, 0 );
if( endp == argv[3] ||
*endp != '\0' ) {
printf("%s not a vaild number\n", argv[3]);
return CMD_E_INVAL_ARG;
}
if( (fd = open( argv[1], O_RDWR | O_CREAT, 0666 )) < 0 ) {
printf( "can't open file \"%s\": %s\n", argv[1],
strerror( errno ) );
return CMD_E_BAD_FILE;
}
for( i=0; i<len ; i+=4 ) {
if( samba_read_word( addr + i, &val ) < 0 ) {
printf( "io error\n" );
return CMD_E_IO_FAILURE;
}
if( write( fd, &val, 4 ) < 4 ) {
printf("write error\n" );
return CMD_E_IO_FAILURE;
}
}
close( fd );
return CMD_E_OK;
}
static int cmd_read( int argc, char *argv[] )
{
unsigned long int addr;
unsigned long int len;
int fd;
int i;
char *endp;
int read_len;
uint8_t buff[0x80];
if( argc != 4 ) {
printf( "wrong number of args\n");
return CMD_E_WRONG_NUM_ARGS;
}
addr = strtoul( argv[2], &endp, 0 );
if( endp == argv[2] ||
*endp != '\0' ) {
printf("%s not a vaild number\n", argv[2]);
return CMD_E_INVAL_ARG;
}
len = strtoul( argv[3], &endp, 0 );
if( endp == argv[3] ||
*endp != '\0' ) {
printf("%s not a vaild number\n", argv[3]);
return CMD_E_INVAL_ARG;
}
if( (fd = open( argv[1], O_RDWR | O_CREAT, 0666 )) < 0 ) {
printf( "can't open file \"%s\": %s\n", argv[1],
strerror( errno ) );
return CMD_E_BAD_FILE;
}
for( i=0; i<len ; i+=0x80 ) {
read_len = len-i < 0x80 ? len-i : 0x80;
if( samba_recv_file( addr + i, buff, read_len ) < 0 ) {
printf( "io error\n" );
return CMD_E_IO_FAILURE;
}
if( write( fd, buff, read_len ) < read_len ) {
printf("write error\n" );
return CMD_E_IO_FAILURE;
}
}
close( fd );
return CMD_E_OK;
}
+33
View File
@@ -0,0 +1,33 @@
/*
* cmd.h
*
* Copyright (C) 2005 Erik Gilling, all rights reserved
*
* 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, version 2.
*
*/
#ifndef __cmd_h__
#define __cmd_h__
typedef struct {
int (* func)( int argc, char *argv[] );
char *name;
char *invo;
char *help;
} cmd_t;
#define CMD_E_OK 0
#define CMD_E_WRONG_NUM_ARGS -1
#define CMD_E_INVAL_ARG -2
#define CMD_E_IO_FAILURE -3
#define CMD_E_UNIMP -4
#define CMD_E_BAD_FILE -5
#define CMD_E_NO_MEM -6
cmd_t *cmd_find( char *name );
#endif /* __cmd_h__ */
+1453
View File
File diff suppressed because it is too large Load Diff
+62
View File
@@ -0,0 +1,62 @@
/* config.h. Generated by configure. */
/* config.h.in. Generated from configure.in by autoheader. */
/* Define to 1 if you have the <ctype.h> header file. */
#define HAVE_CTYPE_H 1
/* Define to 1 if you have the <endian.h> header file. */
/* #undef HAVE_ENDIAN_H */
/* Define to 1 if you have the <inttypes.h> header file. */
#define HAVE_INTTYPES_H 1
/* Define to 1 if you have the `readline' library (-lreadline). */
/* #undef HAVE_LIBREADLINE */
/* Define to 1 if you have the <memory.h> header file. */
#define HAVE_MEMORY_H 1
/* Define to 1 if you have the <stdint.h> header file. */
#define HAVE_STDINT_H 1
/* Define to 1 if you have the <stdlib.h> header file. */
#define HAVE_STDLIB_H 1
/* Define to 1 if you have the <strings.h> header file. */
#define HAVE_STRINGS_H 1
/* Define to 1 if you have the <string.h> header file. */
#define HAVE_STRING_H 1
/* Define to 1 if you have the <sys/stat.h> header file. */
#define HAVE_SYS_STAT_H 1
/* Define to 1 if you have the <sys/types.h> header file. */
#define HAVE_SYS_TYPES_H 1
/* Define to 1 if you have the <unistd.h> header file. */
#define HAVE_UNISTD_H 1
/* Name of package */
#define PACKAGE "sam7utils"
/* Define to the address where bug reports for this package should be sent. */
#define PACKAGE_BUGREPORT "konkers@konkers.net"
/* Define to the full name of this package. */
#define PACKAGE_NAME "sam7utils"
/* Define to the full name and version of this package. */
#define PACKAGE_STRING "sam7utils 0.1.0"
/* Define to the one symbol short name of this package. */
#define PACKAGE_TARNAME "sam7utils"
/* Define to the version of this package. */
#define PACKAGE_VERSION "0.1.0"
/* Define to 1 if you have the ANSI C header files. */
#define STDC_HEADERS 1
/* Version number of package */
#define VERSION "0.1.0"
+61
View File
@@ -0,0 +1,61 @@
/* config.h.in. Generated from configure.in by autoheader. */
/* Define to 1 if you have the <ctype.h> header file. */
#undef HAVE_CTYPE_H
/* Define to 1 if you have the <endian.h> header file. */
#undef HAVE_ENDIAN_H
/* Define to 1 if you have the <inttypes.h> header file. */
#undef HAVE_INTTYPES_H
/* Define to 1 if you have the `readline' library (-lreadline). */
#undef HAVE_LIBREADLINE
/* Define to 1 if you have the <memory.h> header file. */
#undef HAVE_MEMORY_H
/* 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/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 <unistd.h> header file. */
#undef HAVE_UNISTD_H
/* 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
+587
View File
@@ -0,0 +1,587 @@
This file contains any messages produced by compilers while
running configure, to aid debugging if configure makes a mistake.
It was created by sam7utils configure 0.1.0, which was
generated by GNU Autoconf 2.59. Invocation command line was
$ ./configure
## --------- ##
## Platform. ##
## --------- ##
hostname = BlubbFish
uname -m = i686
uname -r = 1.0.16(0.48/3/2)
uname -s = MINGW32_NT-6.1
uname -v = 2010-09-29 00:07
/usr/bin/uname -p = unknown
/bin/uname -X = unknown
/bin/arch = unknown
/usr/bin/arch -k = unknown
/usr/convex/getsysinfo = unknown
hostinfo = unknown
/bin/machine = unknown
/usr/bin/oslevel = unknown
/bin/universe = unknown
PATH: .
PATH: /usr/local/bin
PATH: /mingw/bin
PATH: /bin
PATH: /c/Program Files/PC Connectivity Solution/
PATH: /c/Program Files/ATI Stream/bin/x86
PATH: /e/Programme/MikTeX/miktex/bin
PATH: /c/Windows/system32
PATH: /c/Windows
PATH: /c/Windows/System32/Wbem
PATH: /c/Windows/System32/WindowsPowerShell/v1.0/
PATH: /e/Programme/SVN/bin/
PATH: /c/Program Files/ATI Stream/Tools/Stream KernelAnalyzer 1.5/
PATH: /c/VXIPNP/WinNT/Bin
PATH: /e/Programme/JAF
PATH: /e/Programme/hacker/Nmap
PATH: /c/Program Files/OpenVPN/bin
## ----------- ##
## Core tests. ##
## ----------- ##
configure:1349: checking build system type
configure:1367: result: i686-pc-mingw32
configure:1375: checking host system type
configure:1389: result: i686-pc-mingw32
configure:1397: checking target system type
configure:1411: result: i686-pc-mingw32
configure:1440: checking for a BSD-compatible install
configure:1495: result: /bin/install -c
configure:1506: checking whether build environment is sane
configure:1549: result: yes
configure:1573: WARNING: `missing' script is too old or missing
configure:1614: checking for gawk
configure:1630: found /bin/gawk
configure:1640: result: gawk
configure:1650: checking whether make sets $(MAKE)
configure:1670: result: yes
configure:1888: checking for gcc
configure:1904: found /mingw/bin/gcc
configure:1914: result: gcc
configure:2158: checking for C compiler version
configure:2161: gcc --version </dev/null >&5
gcc.exe (GCC) 4.5.2
Copyright (C) 2010 Free Software Foundation, Inc.
This is free software; see the source for copying conditions. There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
configure:2164: $? = 0
configure:2166: gcc -v </dev/null >&5
Using built-in specs.
COLLECT_GCC=E:\Programme\mingw\bin\gcc.exe
COLLECT_LTO_WRAPPER=e:/programme/mingw/bin/../libexec/gcc/mingw32/4.5.2/lto-wrapper.exe
Target: mingw32
Configured with: ../gcc-4.5.2/configure --enable-languages=c,c++,ada,fortran,objc,obj-c++ --disable-sjlj-exceptions --with-dwarf2 --enable-shared --enable-libgomp --disable-win32-registry --enable-libstdcxx-debug --enable-version-specific-runtime-libs --disable-werror --build=mingw32 --prefix=/mingw
Thread model: win32
gcc version 4.5.2 (GCC)
configure:2169: $? = 0
configure:2171: gcc -V </dev/null >&5
gcc.exe: '-V' option must have argument
configure:2174: $? = 1
configure:2197: checking for C compiler default output file name
configure:2200: gcc conftest.c >&5
configure:2203: $? = 0
configure:2249: result: a.exe
configure:2254: checking whether the C compiler works
configure:2260: ./a.exe
configure:2263: $? = 0
configure:2280: result: yes
configure:2287: checking whether we are cross compiling
configure:2289: result: no
configure:2292: checking for suffix of executables
configure:2294: gcc -o conftest.exe conftest.c >&5
configure:2297: $? = 0
configure:2322: result: .exe
configure:2328: checking for suffix of object files
configure:2349: gcc -c conftest.c >&5
configure:2352: $? = 0
configure:2374: result: o
configure:2378: checking whether we are using the GNU C compiler
configure:2402: gcc -c conftest.c >&5
configure:2408: $? = 0
configure:2412: test -z
|| test ! -s conftest.err
configure:2415: $? = 0
configure:2418: test -s conftest.o
configure:2421: $? = 0
configure:2434: result: yes
configure:2440: checking whether gcc accepts -g
configure:2461: gcc -c -g conftest.c >&5
configure:2467: $? = 0
configure:2471: test -z
|| test ! -s conftest.err
configure:2474: $? = 0
configure:2477: test -s conftest.o
configure:2480: $? = 0
configure:2491: result: yes
configure:2508: checking for gcc option to accept ANSI C
configure:2578: gcc -c -g -O2 conftest.c >&5
configure:2584: $? = 0
configure:2588: test -z
|| test ! -s conftest.err
configure:2591: $? = 0
configure:2594: test -s conftest.o
configure:2597: $? = 0
configure:2615: result: none needed
configure:2633: gcc -c -g -O2 conftest.c >&5
conftest.c:2:9: error: expected '=', ',', ';', 'asm' or '__attribute__' before 'me'
configure:2639: $? = 1
configure: failed program was:
| #ifndef __cplusplus
| choke me
| #endif
configure:2783: checking for style of include used by make
configure:2811: result: GNU
configure:2839: checking dependency style of gcc
configure:2929: result: gcc3
configure:2959: checking for a BSD-compatible install
configure:3014: result: /bin/install -c
configure:3025: checking whether make sets $(MAKE)
configure:3045: result: yes
configure:3076: checking how to run the C preprocessor
configure:3111: gcc -E conftest.c
configure:3117: $? = 0
configure:3149: gcc -E conftest.c
conftest.c:11:28: fatal error: ac_nonexistent.h: No such file or directory
compilation terminated.
configure:3155: $? = 1
configure: failed program was:
| /* confdefs.h. */
|
| #define PACKAGE_NAME "sam7utils"
| #define PACKAGE_TARNAME "sam7utils"
| #define PACKAGE_VERSION "0.1.0"
| #define PACKAGE_STRING "sam7utils 0.1.0"
| #define PACKAGE_BUGREPORT "konkers@konkers.net"
| #define PACKAGE "sam7utils"
| #define VERSION "0.1.0"
| /* end confdefs.h. */
| #include <ac_nonexistent.h>
configure:3194: result: gcc -E
configure:3218: gcc -E conftest.c
configure:3224: $? = 0
configure:3256: gcc -E conftest.c
conftest.c:11:28: fatal error: ac_nonexistent.h: No such file or directory
compilation terminated.
configure:3262: $? = 1
configure: failed program was:
| /* confdefs.h. */
|
| #define PACKAGE_NAME "sam7utils"
| #define PACKAGE_TARNAME "sam7utils"
| #define PACKAGE_VERSION "0.1.0"
| #define PACKAGE_STRING "sam7utils 0.1.0"
| #define PACKAGE_BUGREPORT "konkers@konkers.net"
| #define PACKAGE "sam7utils"
| #define VERSION "0.1.0"
| /* end confdefs.h. */
| #include <ac_nonexistent.h>
configure:3306: checking for egrep
configure:3316: result: grep -E
configure:3321: checking for ANSI C header files
configure:3346: gcc -c -g -O2 conftest.c >&5
configure:3352: $? = 0
configure:3356: test -z
|| test ! -s conftest.err
configure:3359: $? = 0
configure:3362: test -s conftest.o
configure:3365: $? = 0
configure:3454: gcc -o conftest.exe -g -O2 conftest.c >&5
conftest.c: In function 'main':
conftest.c:28:7: warning: incompatible implicit declaration of built-in function 'exit'
configure:3457: $? = 0
configure:3459: ./conftest.exe
configure:3462: $? = 0
configure:3477: result: yes
configure:3502: checking for sys/types.h
configure:3518: gcc -c -g -O2 conftest.c >&5
configure:3524: $? = 0
configure:3528: test -z
|| test ! -s conftest.err
configure:3531: $? = 0
configure:3534: test -s conftest.o
configure:3537: $? = 0
configure:3548: result: yes
configure:3502: checking for sys/stat.h
configure:3518: gcc -c -g -O2 conftest.c >&5
configure:3524: $? = 0
configure:3528: test -z
|| test ! -s conftest.err
configure:3531: $? = 0
configure:3534: test -s conftest.o
configure:3537: $? = 0
configure:3548: result: yes
configure:3502: checking for stdlib.h
configure:3518: gcc -c -g -O2 conftest.c >&5
configure:3524: $? = 0
configure:3528: test -z
|| test ! -s conftest.err
configure:3531: $? = 0
configure:3534: test -s conftest.o
configure:3537: $? = 0
configure:3548: result: yes
configure:3502: checking for string.h
configure:3518: gcc -c -g -O2 conftest.c >&5
configure:3524: $? = 0
configure:3528: test -z
|| test ! -s conftest.err
configure:3531: $? = 0
configure:3534: test -s conftest.o
configure:3537: $? = 0
configure:3548: result: yes
configure:3502: checking for memory.h
configure:3518: gcc -c -g -O2 conftest.c >&5
configure:3524: $? = 0
configure:3528: test -z
|| test ! -s conftest.err
configure:3531: $? = 0
configure:3534: test -s conftest.o
configure:3537: $? = 0
configure:3548: result: yes
configure:3502: checking for strings.h
configure:3518: gcc -c -g -O2 conftest.c >&5
configure:3524: $? = 0
configure:3528: test -z
|| test ! -s conftest.err
configure:3531: $? = 0
configure:3534: test -s conftest.o
configure:3537: $? = 0
configure:3548: result: yes
configure:3502: checking for inttypes.h
configure:3518: gcc -c -g -O2 conftest.c >&5
configure:3524: $? = 0
configure:3528: test -z
|| test ! -s conftest.err
configure:3531: $? = 0
configure:3534: test -s conftest.o
configure:3537: $? = 0
configure:3548: result: yes
configure:3502: checking for stdint.h
configure:3518: gcc -c -g -O2 conftest.c >&5
configure:3524: $? = 0
configure:3528: test -z
|| test ! -s conftest.err
configure:3531: $? = 0
configure:3534: test -s conftest.o
configure:3537: $? = 0
configure:3548: result: yes
configure:3502: checking for unistd.h
configure:3518: gcc -c -g -O2 conftest.c >&5
configure:3524: $? = 0
configure:3528: test -z
|| test ! -s conftest.err
configure:3531: $? = 0
configure:3534: test -s conftest.o
configure:3537: $? = 0
configure:3548: result: yes
configure:3565: checking for stdint.h
configure:3570: result: yes
configure:3727: checking ctype.h usability
configure:3739: gcc -c -g -O2 conftest.c >&5
configure:3745: $? = 0
configure:3749: test -z
|| test ! -s conftest.err
configure:3752: $? = 0
configure:3755: test -s conftest.o
configure:3758: $? = 0
configure:3768: result: yes
configure:3772: checking ctype.h presence
configure:3782: gcc -E conftest.c
configure:3788: $? = 0
configure:3808: result: yes
configure:3843: checking for ctype.h
configure:3850: result: yes
configure:3877: checking endian.h usability
configure:3889: gcc -c -g -O2 conftest.c >&5
conftest.c:57:20: fatal error: endian.h: No such file or directory
compilation terminated.
configure:3895: $? = 1
configure: failed program was:
| /* confdefs.h. */
|
| #define PACKAGE_NAME "sam7utils"
| #define PACKAGE_TARNAME "sam7utils"
| #define PACKAGE_VERSION "0.1.0"
| #define PACKAGE_STRING "sam7utils 0.1.0"
| #define PACKAGE_BUGREPORT "konkers@konkers.net"
| #define PACKAGE "sam7utils"
| #define VERSION "0.1.0"
| #define STDC_HEADERS 1
| #define HAVE_SYS_TYPES_H 1
| #define HAVE_SYS_STAT_H 1
| #define HAVE_STDLIB_H 1
| #define HAVE_STRING_H 1
| #define HAVE_MEMORY_H 1
| #define HAVE_STRINGS_H 1
| #define HAVE_INTTYPES_H 1
| #define HAVE_STDINT_H 1
| #define HAVE_UNISTD_H 1
| #define HAVE_STDINT_H 1
| #define HAVE_CTYPE_H 1
| /* end confdefs.h. */
| #include <stdio.h>
| #if HAVE_SYS_TYPES_H
| # include <sys/types.h>
| #endif
| #if HAVE_SYS_STAT_H
| # include <sys/stat.h>
| #endif
| #if STDC_HEADERS
| # include <stdlib.h>
| # include <stddef.h>
| #else
| # if HAVE_STDLIB_H
| # include <stdlib.h>
| # endif
| #endif
| #if HAVE_STRING_H
| # if !STDC_HEADERS && HAVE_MEMORY_H
| # include <memory.h>
| # endif
| # include <string.h>
| #endif
| #if HAVE_STRINGS_H
| # include <strings.h>
| #endif
| #if HAVE_INTTYPES_H
| # include <inttypes.h>
| #else
| # if HAVE_STDINT_H
| # include <stdint.h>
| # endif
| #endif
| #if HAVE_UNISTD_H
| # include <unistd.h>
| #endif
| #include <endian.h>
configure:3918: result: no
configure:3922: checking endian.h presence
configure:3932: gcc -E conftest.c
conftest.c:23:20: fatal error: endian.h: No such file or directory
compilation terminated.
configure:3938: $? = 1
configure: failed program was:
| /* confdefs.h. */
|
| #define PACKAGE_NAME "sam7utils"
| #define PACKAGE_TARNAME "sam7utils"
| #define PACKAGE_VERSION "0.1.0"
| #define PACKAGE_STRING "sam7utils 0.1.0"
| #define PACKAGE_BUGREPORT "konkers@konkers.net"
| #define PACKAGE "sam7utils"
| #define VERSION "0.1.0"
| #define STDC_HEADERS 1
| #define HAVE_SYS_TYPES_H 1
| #define HAVE_SYS_STAT_H 1
| #define HAVE_STDLIB_H 1
| #define HAVE_STRING_H 1
| #define HAVE_MEMORY_H 1
| #define HAVE_STRINGS_H 1
| #define HAVE_INTTYPES_H 1
| #define HAVE_STDINT_H 1
| #define HAVE_UNISTD_H 1
| #define HAVE_STDINT_H 1
| #define HAVE_CTYPE_H 1
| /* end confdefs.h. */
| #include <endian.h>
configure:3958: result: no
configure:3993: checking for endian.h
configure:4000: result: no
configure:4129: creating ./config.status
## ---------------------- ##
## Running config.status. ##
## ---------------------- ##
This file was extended by sam7utils config.status 0.1.0, which was
generated by GNU Autoconf 2.59. Invocation command line was
CONFIG_FILES =
CONFIG_HEADERS =
CONFIG_LINKS =
CONFIG_COMMANDS =
$ ./config.status
on BlubbFish
config.status:702: creating Makefile
config.status:806: creating config.h
config.status:1096: executing depfiles commands
## ---------------- ##
## Cache variables. ##
## ---------------- ##
ac_cv_build=i686-pc-mingw32
ac_cv_build_alias=i686-pc-mingw32
ac_cv_c_compiler_gnu=yes
ac_cv_env_CC_set=
ac_cv_env_CC_value=
ac_cv_env_CFLAGS_set=
ac_cv_env_CFLAGS_value=
ac_cv_env_CPPFLAGS_set=
ac_cv_env_CPPFLAGS_value=
ac_cv_env_CPP_set=
ac_cv_env_CPP_value=
ac_cv_env_LDFLAGS_set=
ac_cv_env_LDFLAGS_value=
ac_cv_env_build_alias_set=
ac_cv_env_build_alias_value=
ac_cv_env_host_alias_set=
ac_cv_env_host_alias_value=
ac_cv_env_target_alias_set=
ac_cv_env_target_alias_value=
ac_cv_exeext=.exe
ac_cv_header_ctype_h=yes
ac_cv_header_endian_h=no
ac_cv_header_inttypes_h=yes
ac_cv_header_memory_h=yes
ac_cv_header_stdc=yes
ac_cv_header_stdint_h=yes
ac_cv_header_stdlib_h=yes
ac_cv_header_string_h=yes
ac_cv_header_strings_h=yes
ac_cv_header_sys_stat_h=yes
ac_cv_header_sys_types_h=yes
ac_cv_header_unistd_h=yes
ac_cv_host=i686-pc-mingw32
ac_cv_host_alias=i686-pc-mingw32
ac_cv_objext=o
ac_cv_path_install='/bin/install -c'
ac_cv_prog_AWK=gawk
ac_cv_prog_CPP='gcc -E'
ac_cv_prog_ac_ct_CC=gcc
ac_cv_prog_cc_g=yes
ac_cv_prog_cc_stdc=
ac_cv_prog_egrep='grep -E'
ac_cv_prog_make_make_set=yes
ac_cv_target=i686-pc-mingw32
ac_cv_target_alias=i686-pc-mingw32
am_cv_CC_dependencies_compiler_type=gcc3
## ----------------- ##
## Output variables. ##
## ----------------- ##
ACLOCAL='aclocal-1.9'
AMDEPBACKSLASH='\'
AMDEP_FALSE='#'
AMDEP_TRUE=''
AMTAR='tar'
AUTOCONF='autoconf'
AUTOHEADER='autoheader'
AUTOMAKE='automake-1.9'
AWK='gawk'
CC='gcc'
CCDEPMODE='depmode=gcc3'
CFLAGS='-g -O2'
CPP='gcc -E'
CPPFLAGS=''
CYGPATH_W='echo'
DEFS='-DHAVE_CONFIG_H'
DEPDIR='.deps'
ECHO_C=''
ECHO_N='-n'
ECHO_T=''
EGREP='grep -E'
EXEEXT='.exe'
INSTALL_DATA='${INSTALL} -m 644'
INSTALL_PROGRAM='${INSTALL}'
INSTALL_SCRIPT='${INSTALL}'
INSTALL_STRIP_PROGRAM='${SHELL} $(install_sh) -c -s'
IOTYPE='posix'
LDFLAGS=''
LIBOBJS=''
LIBS='-lreadline -lncurses '
LTLIBOBJS=''
MAKEINFO='makeinfo'
OBJEXT='o'
PACKAGE='sam7utils'
PACKAGE_BUGREPORT='konkers@konkers.net'
PACKAGE_NAME='sam7utils'
PACKAGE_STRING='sam7utils 0.1.0'
PACKAGE_TARNAME='sam7utils'
PACKAGE_VERSION='0.1.0'
PATH_SEPARATOR=':'
SET_MAKE=''
SHELL='/bin/sh'
STRIP=''
VERSION='0.1.0'
ac_ct_CC='gcc'
ac_ct_STRIP=''
am__fastdepCC_FALSE='#'
am__fastdepCC_TRUE=''
am__include='include'
am__leading_dot='.'
am__quote=''
am__tar='${AMTAR} chof - "$$tardir"'
am__untar='${AMTAR} xf -'
bindir='${exec_prefix}/bin'
build='i686-pc-mingw32'
build_alias=''
build_cpu='i686'
build_os='mingw32'
build_vendor='pc'
datadir='${prefix}/share'
exec_prefix='${prefix}'
host='i686-pc-mingw32'
host_alias=''
host_cpu='i686'
host_os='mingw32'
host_vendor='pc'
includedir='${prefix}/include'
infodir='${prefix}/info'
install_sh='/D/Visual Studio 2010/Projects/Matomat/sam7utils/install-sh'
libdir='${exec_prefix}/lib'
libexecdir='${exec_prefix}/libexec'
localstatedir='${prefix}/var'
mandir='${prefix}/man'
mkdir_p='mkdir -p --'
oldincludedir='/usr/include'
prefix='/usr/local'
program_transform_name='s,x,x,'
sbindir='${exec_prefix}/sbin'
sharedstatedir='${prefix}/com'
sysconfdir='${prefix}/etc'
target='i686-pc-mingw32'
target_alias=''
target_cpu='i686'
target_os='mingw32'
target_vendor='pc'
## ----------- ##
## confdefs.h. ##
## ----------- ##
#define HAVE_CTYPE_H 1
#define HAVE_INTTYPES_H 1
#define HAVE_MEMORY_H 1
#define HAVE_STDINT_H 1
#define HAVE_STDINT_H 1
#define HAVE_STDLIB_H 1
#define HAVE_STRINGS_H 1
#define HAVE_STRING_H 1
#define HAVE_SYS_STAT_H 1
#define HAVE_SYS_TYPES_H 1
#define HAVE_UNISTD_H 1
#define PACKAGE "sam7utils"
#define PACKAGE_BUGREPORT "konkers@konkers.net"
#define PACKAGE_NAME "sam7utils"
#define PACKAGE_STRING "sam7utils 0.1.0"
#define PACKAGE_TARNAME "sam7utils"
#define PACKAGE_VERSION "0.1.0"
#define STDC_HEADERS 1
#define VERSION "0.1.0"
configure: exit 0
File diff suppressed because it is too large Load Diff
+1566
View File
File diff suppressed because it is too large Load Diff
+5426
View File
File diff suppressed because it is too large Load Diff
+41
View File
@@ -0,0 +1,41 @@
AC_INIT([sam7utils], [0.1.0], [konkers@konkers.net])
AC_CANONICAL_BUILD
AC_CANONICAL_HOST
AC_CANONICAL_TARGET
AM_INIT_AUTOMAKE(sam7utils,0.1.0)
AM_CONFIG_HEADER(config.h)
AC_PROG_CC
AC_PROG_INSTALL
AC_PROG_MAKE_SET
case "${host}" in
*-*-darwin* )
LIBS="$LIBS -framework IOKIT -framework CoreFoundation"
IOTYPE="iokit"
;;
*-*-cygwin* )
LIBS="$LIBS -lsetupapi"
IOTYPE="win32"
;;
* )
IOTYPE="posix"
;;
esac
AC_HEADER_STDC
AC_CHECK_LIB(readline, readline,,AC_MSG_ERROR(readline not found))
AC_CHECK_HEADERS(stdint.h,,AC_MSG_WARN(can't find stdint.h))
AC_CHECK_HEADERS(ctype.h,,)
AC_CHECK_HEADERS(endian.h,,)
AC_SUBST(IOTYPE)
AC_OUTPUT(Makefile)
+529
View File
@@ -0,0 +1,529 @@
#! /bin/sh
# depcomp - compile a program generating dependencies as side-effects
scriptversion=2005-02-09.22
# Copyright (C) 1999, 2000, 2003, 2004, 2005 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., 59 Temple Place - Suite 330, Boston, MA
# 02111-1307, 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.
"$@" -MT "$object" -MD -MP -MF "$tmpdepfile"
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"
;;
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 mecanism 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 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 '/^# [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:
+11
View File
@@ -0,0 +1,11 @@
ifneq ($(KERNELRELEASE),)
obj-m := at91.o
else
KDIR := /lib/modules/$(shell uname -r)/build
PWD := $(shell pwd)
default:
$(MAKE) -C $(KDIR) SUBDIRS=$(PWD) modules
endif
modules: at91.o
+360
View File
@@ -0,0 +1,360 @@
/*
* at91 boot program driver
*
* Copyright (C) 2005 Erik Gilling
* Copyright (C) 2001-2004 Greg Kroah-Hartman (greg@kroah.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, version 2.
*
* This driver is based on drivers/usb/usb-skeleton.c
*/
#include <linux/config.h>
#include <linux/kernel.h>
#include <linux/errno.h>
#include <linux/init.h>
#include <linux/slab.h>
#include <linux/module.h>
#include <linux/kref.h>
#include <asm/uaccess.h>
#include <linux/usb.h>
/* Define these values to match your devices */
#define USB_VENDOR_ID_ATMEL 0x03eb
#define USB_DEVICE_ID_SAM7BOOT 0x6124
/* table of devices that work with this driver */
static struct usb_device_id at91_table [] = {
{ USB_DEVICE( USB_VENDOR_ID_ATMEL, USB_DEVICE_ID_SAM7BOOT ) },
{ } /* Terminating entry */
};
MODULE_DEVICE_TABLE (usb, at91_table);
/* Get a minor range for your devices from the usb maintainer */
#define USB_AT91_MINOR_BASE 192
/* Structure to hold all of our device specific stuff */
struct usb_at91 {
struct usb_device * udev; /* the usb device for this device */
struct usb_interface * interface; /* the interface for this device */
unsigned char * bulk_in_buffer; /* the buffer to receive data */
size_t bulk_in_size; /* the size of the receive buffer */
__u8 bulk_in_endpointAddr; /* the address of the bulk in endpoint */
__u8 bulk_out_endpointAddr; /* the address of the bulk out endpoint */
struct kref kref;
};
#define to_at91_dev(d) container_of(d, struct usb_at91, kref)
static struct usb_driver at91_driver;
static void at91_delete(struct kref *kref)
{
struct usb_at91 *dev = to_at91_dev(kref);
usb_put_dev(dev->udev);
kfree (dev->bulk_in_buffer);
kfree (dev);
}
static int at91_open(struct inode *inode, struct file *file)
{
struct usb_at91 *dev;
struct usb_interface *interface;
int subminor;
int retval = 0;
subminor = iminor(inode);
interface = usb_find_interface(&at91_driver, subminor);
if (!interface) {
err ("%s - error, can't find device for minor %d",
__FUNCTION__, subminor);
retval = -ENODEV;
goto exit;
}
dev = usb_get_intfdata(interface);
if (!dev) {
retval = -ENODEV;
goto exit;
}
/* increment our usage count for the device */
kref_get(&dev->kref);
/* save our object in the file's private structure */
file->private_data = dev;
exit:
return retval;
}
static int at91_release(struct inode *inode, struct file *file)
{
struct usb_at91 *dev;
dev = (struct usb_at91 *)file->private_data;
if (dev == NULL)
return -ENODEV;
/* decrement the count on our device */
kref_put(&dev->kref, at91_delete);
return 0;
}
static ssize_t at91_read(struct file *file, char *buffer, size_t count, loff_t *ppos)
{
struct usb_at91 *dev;
int retval = 0;
int bytes_read;
dev = (struct usb_at91 *)file->private_data;
/* do a blocking bulk read to get data from the device */
retval = usb_bulk_msg(dev->udev,
usb_rcvbulkpipe(dev->udev, dev->bulk_in_endpointAddr),
dev->bulk_in_buffer,
min(dev->bulk_in_size, count),
&bytes_read, 10000);
/* if the read was successful, copy the data to userspace */
if (!retval) {
if (copy_to_user(buffer, dev->bulk_in_buffer, bytes_read))
retval = -EFAULT;
else
retval = bytes_read;
}
return retval;
}
static void at91_write_bulk_callback(struct urb *urb, struct pt_regs *regs)
{
struct usb_at91 *dev;
dev = (struct usb_at91 *)urb->context;
/* sync/async unlink faults aren't errors */
if (urb->status &&
!(urb->status == -ENOENT ||
urb->status == -ECONNRESET ||
urb->status == -ESHUTDOWN)) {
dbg("%s - nonzero write bulk status received: %d",
__FUNCTION__, urb->status);
}
/* free up our allocated buffer */
usb_buffer_free(urb->dev, urb->transfer_buffer_length,
urb->transfer_buffer, urb->transfer_dma);
}
static ssize_t at91_write(struct file *file, const char *user_buffer, size_t count, loff_t *ppos)
{
struct usb_at91 *dev;
int retval = 0;
struct urb *urb = NULL;
char *buf = NULL;
dev = (struct usb_at91 *)file->private_data;
/* verify that we actually have some data to write */
if (count == 0)
goto exit;
/* create a urb, and a buffer for it, and copy the data to the urb */
urb = usb_alloc_urb(0, GFP_KERNEL);
if (!urb) {
retval = -ENOMEM;
goto error;
}
buf = usb_buffer_alloc(dev->udev, count, GFP_KERNEL, &urb->transfer_dma);
if (!buf) {
retval = -ENOMEM;
goto error;
}
if (copy_from_user(buf, user_buffer, count)) {
retval = -EFAULT;
goto error;
}
/* initialize the urb properly */
usb_fill_bulk_urb(urb, dev->udev,
usb_sndbulkpipe(dev->udev, dev->bulk_out_endpointAddr),
buf, count, at91_write_bulk_callback, dev);
urb->transfer_flags |= URB_NO_TRANSFER_DMA_MAP;
/* send the data out the bulk port */
retval = usb_submit_urb(urb, GFP_KERNEL);
if (retval) {
err("%s - failed submitting write urb, error %d", __FUNCTION__, retval);
goto error;
}
/* release our reference to this urb, the USB core will eventually free it entirely */
usb_free_urb(urb);
exit:
return count;
error:
usb_buffer_free(dev->udev, count, buf, urb->transfer_dma);
usb_free_urb(urb);
return retval;
}
static struct file_operations at91_fops = {
.owner = THIS_MODULE,
.read = at91_read,
.write = at91_write,
.open = at91_open,
.release = at91_release,
};
/*
* usb class driver info in order to get a minor number from the usb core,
* and to have the device registered with devfs and the driver core
*/
static struct usb_class_driver at91_class = {
.name = "usb/at91_%d",
.fops = &at91_fops,
.mode = S_IFCHR | S_IRUSR | S_IWUSR | S_IRGRP | S_IWGRP | S_IROTH,
.minor_base = USB_AT91_MINOR_BASE,
};
static int at91_probe(struct usb_interface *interface, const struct usb_device_id *id)
{
struct usb_at91 *dev = NULL;
struct usb_host_interface *iface_desc;
struct usb_endpoint_descriptor *endpoint;
size_t buffer_size;
int i;
int retval = -ENOMEM;
/* allocate memory for our device state and initialize it */
dev = kmalloc(sizeof(*dev), GFP_KERNEL);
if (dev == NULL) {
err("Out of memory");
goto error;
}
memset(dev, 0x00, sizeof(*dev));
kref_init(&dev->kref);
dev->udev = usb_get_dev(interface_to_usbdev(interface));
dev->interface = interface;
/* set up the endpoint information */
/* use only the first bulk-in and bulk-out endpoints */
iface_desc = interface->cur_altsetting;
for (i = 0; i < iface_desc->desc.bNumEndpoints; ++i) {
endpoint = &iface_desc->endpoint[i].desc;
if (!dev->bulk_in_endpointAddr &&
((endpoint->bEndpointAddress & USB_ENDPOINT_DIR_MASK)
== USB_DIR_IN) &&
((endpoint->bmAttributes & USB_ENDPOINT_XFERTYPE_MASK)
== USB_ENDPOINT_XFER_BULK)) {
/* we found a bulk in endpoint */
buffer_size = le16_to_cpu(endpoint->wMaxPacketSize);
dev->bulk_in_size = buffer_size;
dev->bulk_in_endpointAddr = endpoint->bEndpointAddress;
dev->bulk_in_buffer = kmalloc(buffer_size, GFP_KERNEL);
if (!dev->bulk_in_buffer) {
err("Could not allocate bulk_in_buffer");
goto error;
}
}
if (!dev->bulk_out_endpointAddr &&
((endpoint->bEndpointAddress & USB_ENDPOINT_DIR_MASK)
== USB_DIR_OUT) &&
((endpoint->bmAttributes & USB_ENDPOINT_XFERTYPE_MASK)
== USB_ENDPOINT_XFER_BULK)) {
/* we found a bulk out endpoint */
dev->bulk_out_endpointAddr = endpoint->bEndpointAddress;
}
}
if (!(dev->bulk_in_endpointAddr && dev->bulk_out_endpointAddr)) {
err("Could not find both bulk-in and bulk-out endpoints");
goto error;
}
/* save our data pointer in this interface device */
usb_set_intfdata(interface, dev);
/* we can register the device now, as it is ready */
retval = usb_register_dev(interface, &at91_class);
if (retval) {
/* something prevented us from registering this driver */
err("Not able to get a minor for this device.");
usb_set_intfdata(interface, NULL);
goto error;
}
/* let the user know what node this device is now attached to */
info("USB At91 device now attached to AT91-%d", interface->minor);
return 0;
error:
if (dev)
kref_put(&dev->kref, at91_delete);
return retval;
}
static void at91_disconnect(struct usb_interface *interface)
{
struct usb_at91 *dev;
int minor = interface->minor;
/* prevent at91_open() from racing at91_disconnect() */
lock_kernel();
dev = usb_get_intfdata(interface);
usb_set_intfdata(interface, NULL);
/* give back our minor */
usb_deregister_dev(interface, &at91_class);
unlock_kernel();
/* decrement our usage count */
kref_put(&dev->kref, at91_delete);
info("USB At91eton #%d now disconnected", minor);
}
static struct usb_driver at91_driver = {
.owner = THIS_MODULE,
.name = "at91",
.probe = at91_probe,
.disconnect = at91_disconnect,
.id_table = at91_table,
};
static int __init usb_at91_init(void)
{
int result;
/* register this driver with the USB subsystem */
result = usb_register(&at91_driver);
if (result)
err("usb_register failed. Error number %d", result);
return result;
}
static void __exit usb_at91_exit(void)
{
/* deregister this driver with the USB subsystem */
usb_deregister(&at91_driver);
}
module_init (usb_at91_init);
module_exit (usb_at91_exit);
MODULE_LICENSE("GPL");
+323
View File
@@ -0,0 +1,323 @@
#!/bin/sh
# install - install a program, script, or datafile
scriptversion=2005-02-02.21
# 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. It can only install one file at a time, a restriction
# shared with many OS's install programs.
# set DOITPROG to echo to test this script
# Don't use :- since 4.3BSD and earlier shells don't like it.
doit="${DOITPROG-}"
# put in absolute paths if you don't have them in your path; or use env. 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}"
chmodcmd="$chmodprog 0755"
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 -n "$1"; 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) chmodcmd="$chmodprog $2"
shift
shift
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 $?;;
*) # When -d is used, all remaining arguments are directories to create.
# When -t is used, the destination is already specified.
test -n "$dir_arg$dstarg" && break
# 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
break;;
esac
done
if test -z "$1"; 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
for src
do
# Protect names starting with `-'.
case $src in
-*) src=./$src ;;
esac
if test -n "$dir_arg"; then
dst=$src
src=
if test -d "$dst"; then
mkdircmd=:
chmodcmd=
else
mkdircmd=$mkdirprog
fi
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
dst=$dst/`basename "$src"`
fi
fi
# This sed command emulates the dirname command.
dstdir=`echo "$dst" | sed -e 's,/*$,,;s,[^/]*$,,;s,/*$,,;s,^$,.,'`
# Make sure that the destination directory exists.
# Skip lots of stat calls in the usual case.
if test ! -d "$dstdir"; then
defaultIFS='
'
IFS="${IFS-$defaultIFS}"
oIFS=$IFS
# Some sh's can't handle IFS=/ for some reason.
IFS='%'
set x `echo "$dstdir" | sed -e 's@/@%@g' -e 's@^%@/@'`
shift
IFS=$oIFS
pathcomp=
while test $# -ne 0 ; do
pathcomp=$pathcomp$1
shift
if test ! -d "$pathcomp"; then
$mkdirprog "$pathcomp"
# mkdir can fail with a `File exist' error in case several
# install-sh are creating the directory concurrently. This
# is OK.
test -d "$pathcomp" || exit
fi
pathcomp=$pathcomp/
done
fi
if test -n "$dir_arg"; then
$doit $mkdircmd "$dst" \
&& { test -z "$chowncmd" || $doit $chowncmd "$dst"; } \
&& { test -z "$chgrpcmd" || $doit $chgrpcmd "$dst"; } \
&& { test -z "$stripcmd" || $doit $stripcmd "$dst"; } \
&& { test -z "$chmodcmd" || $doit $chmodcmd "$dst"; }
else
dstfile=`basename "$dst"`
# 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
trap '(exit $?); exit' 1 2 13 15
# Copy the file name to the temp name.
$doit $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 "$dsttmp"; } &&
# Now rename the file to the real destination.
{ $doit $mvcmd -f "$dsttmp" "$dstdir/$dstfile" 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 "$dstdir/$dstfile"; then
$doit $rmcmd -f "$dstdir/$dstfile" 2>/dev/null \
|| $doit $mvcmd -f "$dstdir/$dstfile" "$rmtmp" 2>/dev/null \
|| {
echo "$0: cannot unlink or rename $dstdir/$dstfile" >&2
(exit 1); exit 1
}
else
:
fi
} &&
# Now rename the file to the real destination.
$doit $mvcmd "$dsttmp" "$dstdir/$dstfile"
}
}
fi || { (exit 1); exit 1; }
done
# The final little trick to "correctly" pass the exit status to the exit trap.
{
(exit 0); 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:
+46
View File
@@ -0,0 +1,46 @@
/*
* io.h
*
* Copyright (C) 2005 Erik Gilling, all rights reserved
*
* 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, version 2.
*
*/
#ifndef __io_h__
#define __io_h__
#include <unistd.h> // for usleep
int io_init( char *dev );
int io_cleanup( void );
int io_write( void *buff, int len );
int io_read( void *buff, int len );
int io_read_response( char *buff, int len );
static inline int io_send_cmd( char *cmd, void *response, int response_len )
{
if( io_write( cmd, strlen( cmd ) ) < 0 ) {
return -1;
}
usleep( 2000 );
if( response_len == 0 ) {
return 0;
}
if( io_read( response, response_len ) < 0 ) {
return -1;
}
usleep( 2000 );
return 0;
}
#endif /* __io_h__ */
+317
View File
@@ -0,0 +1,317 @@
/*
* io.c
*
* Copyright (C) 2005 Erik Gilling, all rights reserved
*
* 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, version 2.
*
*/
#include "config.h"
#include <stdio.h>
#include <mach/mach.h>
#include <CoreFoundation/CFNumber.h>
#include <IOKit/IOKitLib.h>
#include <IOKit/IOCFPlugIn.h>
#include <IOKit/usb/IOUSBLib.h>
#ifdef HAVE_STDINT_H
#include <stdint.h>
#endif
#include "io.h"
#include "samba.h"
static mach_port_t masterPort = 0;
static IOUSBDeviceInterface **usbDev = NULL;
static IOUSBInterfaceInterface **intf = NULL;
static UInt8 inPipeRef = 0;
static UInt8 outPipeRef = 0;
#undef DEBUG_IO
int do_intf(io_service_t usbInterfaceRef)
{
IOReturn err;
IOCFPlugInInterface **iodev;
SInt32 score;
UInt8 numPipes;
int i;
UInt8 direction, number, transferType, interval;
UInt16 maxPacketSize;
err = IOCreatePlugInInterfaceForService(usbInterfaceRef,
kIOUSBInterfaceUserClientTypeID,
kIOCFPlugInInterfaceID,
&iodev, &score);
if( err || !iodev ) {
printf("unable to create plugin. ret = %08x, iodev = %p\n", err, iodev);
return -1;
}
err = (*iodev)->QueryInterface(iodev,
CFUUIDGetUUIDBytes(kIOUSBInterfaceInterfaceID),
(LPVOID)&intf);
IODestroyPlugInInterface(iodev);
if (err || !intf) {
printf("unable to create a device interface. ret = %08x, intf = %p\n",
err, intf);
return -1;
}
err = (*intf)->USBInterfaceOpen(intf);
if (err) {
printf("unable to open interface. ret = %08x\n", err);
return -1;
}
err = (*intf)->GetNumEndpoints(intf, &numPipes);
if (err) {
printf("unable to get number of endpoints. ret = %08x\n", err);
return -1;
}
if (numPipes) {
for (i=1; i <= numPipes; i++) {
err = (*intf)->GetPipeProperties(intf, i, &direction,
&number, &transferType,
&maxPacketSize, &interval);
if (err) {
printf("unable to get pipe properties for pipe %d, err = %08x\n",
i, err);
continue;
}
if (transferType != kUSBBulk) {
continue;
}
if ((direction == kUSBIn) && !inPipeRef) {
inPipeRef = i;
}
if ((direction == kUSBOut) && !outPipeRef) {
outPipeRef = i;
}
}
}
if( !inPipeRef || !outPipeRef ) {
(*intf)->USBInterfaceClose(intf);
(*intf)->Release(intf);
intf = NULL;
return -1;
}
return 0;
}
static int do_dev( io_service_t usbDeviceRef )
{
IOReturn err;
IOCFPlugInInterface **iodev; // requires <IOKit/IOCFPlugIn.h>
SInt32 score;
UInt8 numConf;
IOUSBConfigurationDescriptorPtr confDesc;
IOUSBFindInterfaceRequest interfaceRequest;
io_iterator_t iterator;
io_service_t usbInterfaceRef;
err = IOCreatePlugInInterfaceForService(usbDeviceRef,
kIOUSBDeviceUserClientTypeID,
kIOCFPlugInInterfaceID, &iodev, &score);
if (err || !iodev) {
printf("unable to create plugin. ret = %08x, iodev = %p\n",
err, iodev);
return -1;
}
err = (*iodev)->QueryInterface(iodev,
CFUUIDGetUUIDBytes(kIOUSBDeviceInterfaceID),
(LPVOID)&usbDev);
IODestroyPlugInInterface(iodev); // done with this
if (err || !usbDev) {
printf("unable to create a device interface. ret = %08x, dev = %p\n",
err, usbDev);
return -1;
}
err = (*usbDev)->USBDeviceOpen(usbDev);
if (err) {
printf("unable to open device. ret = %08x\n", err);
return -1;
}
err = (*usbDev)->GetNumberOfConfigurations(usbDev, &numConf);
if (err || !numConf) {
printf("unable to obtain the number of configurations. ret = %08x\n", err);
return -1;
}
err = (*usbDev)->GetConfigurationDescriptorPtr(usbDev, 0, &confDesc); // get the first config desc (index 0)
if (err) {
printf("unable to get config descriptor for index 0\n");
return -1;
}
err = (*usbDev)->SetConfiguration(usbDev, confDesc->bConfigurationValue);
if (err) {
printf("unable to set the configuration\n");
return -1;
}
// requested class
interfaceRequest.bInterfaceClass = kIOUSBFindInterfaceDontCare;
// requested subclass
interfaceRequest.bInterfaceSubClass = kIOUSBFindInterfaceDontCare;
// requested protocol
interfaceRequest.bInterfaceProtocol = kIOUSBFindInterfaceDontCare;
// requested alt setting
interfaceRequest.bAlternateSetting = kIOUSBFindInterfaceDontCare;
err = (*usbDev)->CreateInterfaceIterator(usbDev, &interfaceRequest, &iterator);
if (err) {
printf("unable to create interface iterator\n");
return -1;
}
while( (usbInterfaceRef = IOIteratorNext(iterator)) ) {
if( do_intf( usbInterfaceRef ) == 0 ) {
IOObjectRelease(iterator);
iterator = 0;
return 0;
}
}
IOObjectRelease(iterator);
iterator = 0;
return -1;
}
int io_init( char *dev __attribute__((unused)) )
{
kern_return_t err;
CFMutableDictionaryRef matchingDictionary = 0;
CFNumberRef numberRef;
SInt32 idVendor = 0x03eb;
SInt32 idProduct = 0x6124;
io_iterator_t iterator = 0;
io_service_t usbDeviceRef;
if( (err = IOMasterPort( MACH_PORT_NULL, &masterPort )) ) {
printf( "could not create master port, err = %08x\n", err );
return -1;
}
if( !(matchingDictionary = IOServiceMatching(kIOUSBDeviceClassName)) ) {
printf( "could not create matching dictionary\n" );
return -1;
}
if( !(numberRef = CFNumberCreate(kCFAllocatorDefault, kCFNumberSInt32Type,
&idVendor)) ) {
printf( "could not create CFNumberRef for vendor\n" );
return -1;
}
CFDictionaryAddValue( matchingDictionary, CFSTR(kUSBVendorID), numberRef);
CFRelease( numberRef );
numberRef = 0;
if( !(numberRef = CFNumberCreate(kCFAllocatorDefault, kCFNumberSInt32Type,
&idProduct)) ) {
printf( "could not create CFNumberRef for product\n" );
return -1;
}
CFDictionaryAddValue( matchingDictionary, CFSTR(kUSBProductID), numberRef);
CFRelease( numberRef );
numberRef = 0;
err = IOServiceGetMatchingServices( masterPort, matchingDictionary, &iterator );
matchingDictionary = 0; // consumed by the above call
if( (usbDeviceRef = IOIteratorNext( iterator )) ) {
printf( "found boot agent\n" );
do_dev( usbDeviceRef );
} else {
printf( "can not find boot agent\n" );
return -1;
}
IOObjectRelease(usbDeviceRef);
IOObjectRelease(iterator);
return samba_init();
IOObjectRelease(usbDeviceRef);
IOObjectRelease(iterator);
return -1;
}
int io_cleanup( void )
{
if( intf ) {
(*intf)->USBInterfaceClose(intf);
(*intf)->Release(intf);
intf = NULL;
}
if( usbDev ) {
(*usbDev)->USBDeviceClose(usbDev);
(*usbDev)->Release(usbDev);
usbDev = NULL;
}
return 0;
}
int io_write( void *buff, int len )
{
if( (*intf)->WritePipe( intf, outPipeRef, buff, (UInt32) len ) !=
kIOReturnSuccess ) {
printf( "write error\n");
}
return len;
}
int io_read( void *buff, int len )
{
UInt32 size = len;
if( (*intf)->ReadPipe( intf, inPipeRef, buff, &size ) !=
kIOReturnSuccess ) {
printf( "read error\n");
}
return (int) size;
}
+161
View File
@@ -0,0 +1,161 @@
/*
* io.c
*
* Copyright (C) 2005 Erik Gilling, all rights reserved
*
* 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, version 2.
*
*/
#include "config.h"
#include <unistd.h>
#include <sys/types.h>
#include <sys/stat.h>
#include <fcntl.h>
#include <sys/select.h>
#include <sys/termios.h>
#include <stdio.h>
#include <string.h>
#include <errno.h>
#ifdef HAVE_STDINT_H
#include <stdint.h>
#endif
#include "io.h"
#include "samba.h"
static int io_fd;
#define SAM7_TTY "/dev/ttyUSB0"
#undef DEBUG_IO
int io_init( char *dev )
{
struct termios port_setting;
if( dev == NULL ) {
dev = SAM7_TTY;
}
// char buff[16];
if( (io_fd = open( dev, O_RDWR )) < 0 ) {
printf( "can't open \"%s\": %s\n", dev, strerror( errno ) );
return -1;
}
if(tcgetattr(io_fd, &port_setting)!=0)
return -2;
port_setting.c_iflag = IGNBRK | IGNPAR;
port_setting.c_cflag = B115200 | CS8 | CREAD | HUPCL | CLOCAL;
port_setting.c_oflag = 0;
port_setting.c_lflag = 0;
if(tcsetattr(io_fd, TCSAFLUSH, &port_setting)!=0)
return -3;
else
return samba_init();
}
int io_cleanup( void )
{
close( io_fd );
return 0;
}
int io_write( void *buff, int len )
{
int write_len = 0;
int ret;
#ifdef DEBUG_IO
write( STDOUT_FILENO, ">", 1 );
write( STDOUT_FILENO, buff, len );
write( STDOUT_FILENO, "\n", 1 );
#endif
while( write_len < len ) {
if( (ret = write( io_fd, buff + write_len, len - write_len )) < 0 ) {
return -1;
}
write_len += ret;
}
return write_len;
}
int io_read( void *buff, int len )
{
#ifdef DEBUG_IO
int i;
char outbuff[16];
len = read( io_fd, buff, len );
write( STDOUT_FILENO, "<", 1 );
for( i=0 ; i<len ; i++ ) {
snprintf( outbuff, 16, " %02X", ((char*)buff)[i] & 0xff );
write( STDOUT_FILENO, outbuff, strlen(outbuff) );
}
write( STDOUT_FILENO, "\n", 1 );
return len;
#else
return read( io_fd, buff, len );
#endif
}
#if 0
int io_read_response( char *buff, int len )
{
int read_len = 0;
struct timeval tv;
fd_set fds;
int ret;
while( read_len < len ) {
tv.tv_sec = 1;
tv.tv_usec = 0;
FD_ZERO( &fds );
FD_SET( io_fd, &fds );
if( (ret = select( io_fd + 1, &fds, NULL, NULL, &tv )) < 0 ) {
if( errno == EINTR ) {
continue;
}
}
if( ret == 0 ) {
buff[read_len] = '\0';
printf( "timeout '%s'\n", buff);
return -read_len;
}
if( (ret = read( io_fd, buff + read_len, len - read_len )) < 0 ) {
return -1;
}
read_len += ret;
if( (read_len > 0) &&
buff[ read_len - 1 ] == '>' ) {
if( (read_len > 2) &&
buff[ read_len - 2 ] == '\r' &&
buff[ read_len - 3 ] == '\n' ) {
return buff[read_len - 3] = '\0' ;
return read_len-3 ;
} else {
return buff[read_len - 1] = '\0' ;
return read_len-1 ;
}
}
}
return read_len;
}
#endif
+173
View File
@@ -0,0 +1,173 @@
/*
* io_win32.c
*
* Copyright (C) 2005 Erik Gilling, all rights reserved
*
* 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, version 2.
*
*
* USB device enumeration modeled from http://www.delcom-eng.com/downloads/USBPRGMNL.pdf
*
*/
#include "config.h"
#define WINVER 0x0500
#define INITGUID
#include <windows.h>
#include <setupapi.h>
#include <basetyps.h>
#include <stdio.h>
#include "io.h"
#include "samba.h"
// {E6EF7DCD-1795-4a08-9FBF-AA78423C26F0}
DEFINE_GUID(USBIODS_GUID,
0xe6ef7dcd, 0x1795, 0x4a08, 0x9f, 0xbf, 0xaa, 0x78, 0x42, 0x3c, 0x26, 0xf0);
HANDLE io_pipe_in, io_pipe_out;
int io_init( char *dev )
{
char *devname;
// char buff[16];
HDEVINFO hInfo = SetupDiGetClassDevs(&USBIODS_GUID, NULL,
NULL, DIGCF_PRESENT |
DIGCF_INTERFACEDEVICE);
SP_INTERFACE_DEVICE_DATA Interface_Info;
Interface_Info.cbSize = sizeof(Interface_Info);
// Enumerate device
if( !SetupDiEnumDeviceInterfaces(hInfo, NULL, (LPGUID)
&USBIODS_GUID,0, &Interface_Info ) ) {
printf( "can't find boot agent\n");
goto error0;
}
DWORD needed; // get the required lenght
SetupDiGetInterfaceDeviceDetail(hInfo, &Interface_Info,
NULL, 0, &needed, NULL);
PSP_INTERFACE_DEVICE_DETAIL_DATA detail =
(PSP_INTERFACE_DEVICE_DETAIL_DATA) malloc(needed);
if( !detail ) {
printf( "can't find boot agent\n");
goto error0;
return(-1);
}
// fill the device details
detail->cbSize = sizeof(SP_INTERFACE_DEVICE_DETAIL_DATA);
if( !SetupDiGetInterfaceDeviceDetail( hInfo,
&Interface_Info,detail,
needed,NULL, NULL )) {
printf( "can't find boot agent\n");
goto error1;
}
devname = (char *) malloc( strlen( detail->DevicePath ) + 7 );
strcpy( devname, detail->DevicePath );
strcat( devname, "\\PIPE00" );
printf( "%s\n", devname );
// open out
io_pipe_out = CreateFile( devname, GENERIC_READ | GENERIC_WRITE,
FILE_SHARE_READ, NULL, OPEN_EXISTING,
0, NULL );
if( io_pipe_out == INVALID_HANDLE_VALUE ) {
printf( "can't open output pipe\n" );
goto error2;
}
strcpy( devname, detail->DevicePath );
strcat( devname, "\\PIPE01" );
// open in
io_pipe_in = CreateFile( devname, GENERIC_READ | GENERIC_WRITE,
FILE_SHARE_READ, NULL, OPEN_EXISTING,
0, NULL );
if( io_pipe_in == INVALID_HANDLE_VALUE ) {
printf( "can't open input pipe\n" );
goto error3;
}
free((PVOID) detail);
free( devname );
return samba_init();
return 0;
// return samba_init();
error3:
CloseHandle( io_pipe_out );
error2:
free( devname );
error1:
free((PVOID) detail);
error0:
SetupDiDestroyDeviceInfoList(hInfo);
return -1;
}
int io_cleanup( void )
{
CloseHandle( io_pipe_out );
CloseHandle( io_pipe_in );
return 0;
}
int io_write( void *buff, int len )
{
int write_len = 0;
DWORD bytes_written;
while( write_len < len ) {
if( !WriteFile( io_pipe_out, buff + write_len,
len - write_len, &bytes_written, NULL ) ) {
return -1;
}
write_len += bytes_written;
}
return write_len;
}
int io_read( void *buff, int len )
{
int read_len = 0;
DWORD bytes_read;
while( read_len < len ) {
if( !ReadFile( io_pipe_in, buff + read_len,
len - read_len, &bytes_read, NULL ) ) {
return -1;
}
read_len += bytes_read;
}
return read_len;
}
+36
View File
@@ -0,0 +1,36 @@
CC=arm-elf-gcc
LD=arm-elf-ld
AR=arm-elf-ar
AS=arm-elf-as
OBJCOPY=arm-elf-objcopy
OBJDUMP=arm-elf-objdump
CFLAGS=-nostartfiles -nostdlib -nodefaultlibs -g -O2
LDFLAGS=-Tloader.lds
all: loader128.bin loader256.bin
headers: loader128.bin loader256.bin
gcc -o bin2c bin2c.c
./bin2c loader128_data < loader128.bin > ../loader128_data.h
./bin2c loader256_data < loader256.bin > ../loader256_data.h
loader128.elf: crt0.o loader128.o
${CC} ${CFLAGS} ${LDFLAGS} -o $@ $^
loader256.elf: crt0.o loader256.o
${CC} ${CFLAGS} ${LDFLAGS} -o $@ $^
loader128.o: loader.c
${CC} ${CFLAGS} -DPAGE_SIZE=128 -c -o $@ $^
loader256.o: loader.c
${CC} ${CFLAGS} -DPAGE_SIZE=256 -c -o $@ $^
%.bin: %.elf
${OBJCOPY} -O binary $^ $@
clean:
rm -f loader128.o loader256.o loader128.elf loader256.elf \
loader128.bin loader256.bin crt0.o bin2c bin2c.exe
+61
View File
@@ -0,0 +1,61 @@
/*
* loader/at91.h
*
* Copyright (C) 2006 Erik Gilling, all rights reserved
*
* 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, version 2.
*
*/
#define AT91_FLASH_ADDR ((uint32_t *) 0x100000)
typedef unsigned int uint32_t;
typedef signed int int32_t;
typedef unsigned short uint16_t;
typedef signed short int16_t;
typedef unsigned char uint8_t;
typedef signed char int8_t;
typedef volatile uint32_t arm_reg_t;
typedef struct {
arm_reg_t rcr; /* 00 - Remap Control Register */
arm_reg_t asr; /* 04 - Abort Status Rebister */
arm_reg_t aasr; /* 08 - Abort Address Status Register */
arm_reg_t res[21]; /* 0C..5C - Reserved */
arm_reg_t fmr; /* 60 - Flash Mode Register */
arm_reg_t fcr; /* 64 - Flash Command Register */
arm_reg_t fsr; /* 68 - Flash Status Register */
} at91_mc_t;
extern volatile at91_mc_t mc;
#define AT91_MC_FMR_FRDY (1<<0)
#define AT91_MC_FMR_LOCKE (1<<2)
#define AT91_MC_FMR_PROGE (1<<3)
#define AT91_MC_FMR_NEBP (1<<7)
#define AT91_MC_FMR_WAIT_STATE_1_2 (0<<8)
#define AT91_MC_FMR_WAIT_STATE_2_3 (1<<8)
#define AT91_MC_FMR_WAIT_STATE_3_4 (2<<8)
#define AT91_MC_FMR_WAIT_STATE_4_4 (3<<8)
#define AT91_MC_FMR_FMCN( x ) (((x)&0xff) << 16)
#define AT91_MC_FCR_FCMD_NOP 0x0
#define AT91_MC_FCR_FCMD_WP 0x1
#define AT91_MC_FCR_FCMD_SLB 0x2
#define AT91_MC_FCR_FCMD_WPL 0x3
#define AT91_MC_FCR_FCMD_CLB 0x4
#define AT91_MC_FCR_FCMD_EA 0x8
#define AT91_MC_FCR_FCMD_SGPB 0xb
#define AT91_MC_FCR_FCMD_CGPB 0xd
#define AT91_MC_FCR_FCMD_SSB 0xf
#define AT91_MC_FCR_PAGEN( x ) (((x)&0x3ff)<<8)
#define AT91_MC_FCR_KEY (0x5A << 24)
+30
View File
@@ -0,0 +1,30 @@
#include <stdio.h>
int main( int argc, char *argv[] )
{
char *data_name = "data";
int c;
int i=0;
if( argc == 2 ) {
data_name = argv[1];
}
printf( "uint8_t %s[] = {\n", data_name );
while( (c = getchar()) >= 0 ) {
if( i== 0 ) {
printf( "\t" );
} else if( i%8 == 0 ) {
printf( ",\n\t" );
} else {
printf( ", " );
}
i++;
printf( "0x%02x", c );
}
printf( "\n};\n" );
return 0;
}
+28
View File
@@ -0,0 +1,28 @@
//
// loader/crt0.S
//
// Copyright (C) 2006 Erik Gilling, all rights reserved
//
// 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, version 2.
//
//
.EQU STACK, 0x201C00
.code 32
.align 2
.global _entry
.func _entry
_entry:
// init stack
ldr sp, =STACK
// save lr
stmfd sp!, {lr}
bl main
ldmia sp!, {r0}
bx r0
+48
View File
@@ -0,0 +1,48 @@
/*
* loader/loader.c
*
* Copyright (C) 2006 Erik Gilling, all rights reserved
*
* 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, version 2.
*
*/
#include "at91.h"
// SAM-BA apears to write the following data to 0x201400
//
// 0x00: data0
// 0x01: data1
// ...
// PAGE_SIZE-1: last data byte
// PAGE_SIZE : page number to write
#define SAMBA_PAGE_BUFF ((uint32_t *) 0x201400)
int main( void )
{
int i;
uint32_t *page_buff = SAMBA_PAGE_BUFF;
// keep this in units of 32 bit words
int page_num = *(page_buff+PAGE_SIZE/4);
int page_offset = page_num * PAGE_SIZE/4;
// wait for mc to be ready
while( !(mc.fsr & AT91_MC_FMR_FRDY) ) { }
// write samba page buffer to flash buffer
for( i=0 ; i < (PAGE_SIZE/4) ; i++ ) {
AT91_FLASH_ADDR[ page_offset + i ] = page_buff[i];
}
// write page
mc.fcr = AT91_MC_FCR_FCMD_WP | AT91_MC_FCR_PAGEN(page_num) |
AT91_MC_FCR_KEY;
// dont wait for mc to be ready here so that flash ops can stack
return 0;
}
+128
View File
@@ -0,0 +1,128 @@
/***********************************************************************/
/* */
/* ROM.ld: Linker Script File */
/* */
/***********************************************************************/
ENTRY(_entry)
MEMORY
{
LOADER(rwx) : ORIGIN = 0x00201600, LENGTH = 0xEA00
}
/* Section Definitions */
SECTIONS
{
/* first section is .text which is used for code */
.text :
{
_text = .;
PROVIDE (text = _text);
*crt0.o (.text) /* Startup code */
*(.text .text.*) /* remaining code */
*(.gnu.linkonce.t.*)
*(.glue_7)
*(.glue_7t)
*(.gcc_except_table)
*(.rodata) /* read-only data (constants) */
*(.rodata*)
*(.gnu.linkonce.r.*)
} > LOADER
. = ALIGN(4);
_etext = . ;
PROVIDE (etext = .);
/* .data section which is used for initialized data */
.data : AT (_etext)
{
_data = .;
*(.data)
*(.data.*)
*(.gnu.linkonce.d*)
SORT(CONSTRUCTORS) /* mt 4/2005 */
} > LOADER
. = ALIGN(4);
_edata = . ;
PROVIDE (edata = .);
/* .bss section which is used for uninitialized data */
.bss (NOLOAD) :
{
__bss_start = . ;
__bss_start__ = . ;
*(.bss)
*(.gnu.linkonce.b*)
*(COMMON)
. = ALIGN(4);
} > LOADER
. = ALIGN(4);
__bss_end__ = . ;
PROVIDE (__bss_end = .);
_end = . ;
PROVIDE (end = .);
/* Stabs debugging sections. */
.stab 0 : { *(.stab) }
.stabstr 0 : { *(.stabstr) }
.stab.excl 0 : { *(.stab.excl) }
.stab.exclstr 0 : { *(.stab.exclstr) }
.stab.index 0 : { *(.stab.index) }
.stab.indexstr 0 : { *(.stab.indexstr) }
.comment 0 : { *(.comment) }
/* DWARF debug sections.
Symbols in the DWARF debugging sections are relative to the beginning
of the section so we begin them at 0. */
/* DWARF 1 */
.debug 0 : { *(.debug) }
.line 0 : { *(.line) }
/* GNU DWARF 1 extensions */
.debug_srcinfo 0 : { *(.debug_srcinfo) }
.debug_sfnames 0 : { *(.debug_sfnames) }
/* DWARF 1.1 and DWARF 2 */
.debug_aranges 0 : { *(.debug_aranges) }
.debug_pubnames 0 : { *(.debug_pubnames) }
/* DWARF 2 */
.debug_info 0 : { *(.debug_info .gnu.linkonce.wi.*) }
.debug_abbrev 0 : { *(.debug_abbrev) }
.debug_line 0 : { *(.debug_line) }
.debug_frame 0 : { *(.debug_frame) }
.debug_str 0 : { *(.debug_str) }
.debug_loc 0 : { *(.debug_loc) }
.debug_macinfo 0 : { *(.debug_macinfo) }
/* SGI/MIPS DWARF 2 extensions */
.debug_weaknames 0 : { *(.debug_weaknames) }
.debug_funcnames 0 : { *(.debug_funcnames) }
.debug_typenames 0 : { *(.debug_typenames) }
.debug_varnames 0 : { *(.debug_varnames) }
}
PROVIDE(tc = 0xFFFA0000);
PROVIDE(udp = 0xFFFB0000);
PROVIDE(twi = 0xFFFB8000);
PROVIDE(usart0 = 0xFFFC0000);
PROVIDE(usart1 = 0xFFFC4000);
PROVIDE(pwmc = 0xFFFCC000);
PROVIDE(ssc = 0xFFFD4000);
PROVIDE(adc = 0xFFFD8000);
PROVIDE(spi = 0xFFFE0000);
PROVIDE(aic = 0xFFFFF000);
PROVIDE(dbgu = 0xFFFFF200);
PROVIDE(pioa = 0xFFFFF400);
PROVIDE(pmc = 0xFFFFFC00);
PROVIDE(rstc = 0xFFFFFD00);
PROVIDE(rtt = 0xFFFFFD20);
PROVIDE(pit = 0xFFFFFD30);
PROVIDE(wdt = 0xFFFFFD40);
PROVIDE(vreg = 0xFFFFFD60);
PROVIDE(mc = 0xFFFFFF00);
+18
View File
@@ -0,0 +1,18 @@
uint8_t loader128_data[] = {
0x0c, 0xd0, 0x9f, 0xe5, 0x00, 0x40, 0x2d, 0xe9,
0x02, 0x00, 0x00, 0xeb, 0x01, 0x00, 0xbd, 0xe8,
0x10, 0xff, 0x2f, 0xe1, 0x00, 0x1c, 0x20, 0x00,
0x30, 0x40, 0x2d, 0xe9, 0x02, 0xe6, 0xa0, 0xe3,
0x05, 0xeb, 0x8e, 0xe2, 0x80, 0x50, 0x9e, 0xe5,
0x4c, 0x40, 0x9f, 0xe5, 0x85, 0x02, 0xa0, 0xe1,
0x68, 0x30, 0x94, 0xe5, 0x01, 0x00, 0x13, 0xe3,
0xfc, 0xff, 0xff, 0x0a, 0x00, 0x10, 0xa0, 0xe3,
0x01, 0xc6, 0xa0, 0xe3, 0x01, 0x20, 0x80, 0xe0,
0x01, 0x31, 0x9e, 0xe7, 0x01, 0x10, 0x81, 0xe2,
0x1f, 0x00, 0x51, 0xe3, 0x02, 0x31, 0x8c, 0xe7,
0xf9, 0xff, 0xff, 0xda, 0x05, 0x3b, 0xa0, 0xe1,
0x23, 0x3b, 0xa0, 0xe1, 0x03, 0x34, 0xa0, 0xe1,
0x5a, 0x34, 0x83, 0xe3, 0x01, 0x30, 0x83, 0xe3,
0x00, 0x00, 0xa0, 0xe3, 0x64, 0x30, 0x84, 0xe5,
0x30, 0x80, 0xbd, 0xe8, 0x00, 0xff, 0xff, 0xff
};
+18
View File
@@ -0,0 +1,18 @@
uint8_t loader256_data[] = {
0x0c, 0xd0, 0x9f, 0xe5, 0x00, 0x40, 0x2d, 0xe9,
0x02, 0x00, 0x00, 0xeb, 0x01, 0x00, 0xbd, 0xe8,
0x10, 0xff, 0x2f, 0xe1, 0x00, 0x1c, 0x20, 0x00,
0x30, 0x40, 0x2d, 0xe9, 0x02, 0xe6, 0xa0, 0xe3,
0x05, 0xeb, 0x8e, 0xe2, 0x00, 0x51, 0x9e, 0xe5,
0x4c, 0x40, 0x9f, 0xe5, 0x05, 0x03, 0xa0, 0xe1,
0x68, 0x30, 0x94, 0xe5, 0x01, 0x00, 0x13, 0xe3,
0xfc, 0xff, 0xff, 0x0a, 0x00, 0x10, 0xa0, 0xe3,
0x01, 0xc6, 0xa0, 0xe3, 0x01, 0x20, 0x80, 0xe0,
0x01, 0x31, 0x9e, 0xe7, 0x01, 0x10, 0x81, 0xe2,
0x3f, 0x00, 0x51, 0xe3, 0x02, 0x31, 0x8c, 0xe7,
0xf9, 0xff, 0xff, 0xda, 0x05, 0x3b, 0xa0, 0xe1,
0x23, 0x3b, 0xa0, 0xe1, 0x03, 0x34, 0xa0, 0xe1,
0x5a, 0x34, 0x83, 0xe3, 0x01, 0x30, 0x83, 0xe3,
0x00, 0x00, 0xa0, 0xe3, 0x64, 0x30, 0x84, 0xe5,
0x30, 0x80, 0xbd, 0xe8, 0x00, 0xff, 0xff, 0xff
};
+170
View File
@@ -0,0 +1,170 @@
/*
* main.c
*
* Copyright (C) 2005 Erik Gilling, all rights reserved
*
* 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, version 2.
*
*/
#include "config.h"
#include <unistd.h>
#include <sys/types.h>
#include <sys/stat.h>
#include <fcntl.h>
#include <stdio.h>
#include <string.h>
#include <errno.h>
#ifdef HAVE_CTYPE_H
#include <ctype.h>
#endif
#include <readline/readline.h>
#include <readline/history.h>
#include <getopt.h>
#include "io.h"
#include "samba.h"
#include "cmd.h"
#define SAM7_TTY "/dev/ttyUSB0"
static int sam7_parse_line( char *line, char *argv[] );
static int sam7_handle_line( char *line );
static void usage( void );
#define MAX_CMDS 32
int main( int argc, char *argv[] )
{
char *cmdline;
char *line = NULL;
char *cmds[MAX_CMDS];
int n_cmds=0;
int c,i;
while( 1 ) {
int option_index;
static struct option long_options[] = {
{ "line", 1, 0, 'l' },
{ "help", 0, 0, 'h' },
{ "exec", 1, 0, 'e' }
};
c = getopt_long( argc, argv, "l:e:h", long_options, &option_index );
if( c == -1 ) {
break;
}
switch( c ) {
case 'l':
line = optarg;
break;
case 'e':
if( n_cmds >= MAX_CMDS ) {
printf( "to many commands, increase MAX_CMDS\n" );
return 1;
}
cmds[n_cmds] = optarg;
n_cmds++;
break;
case 'h':
usage();
return 0;
break;
default:
printf( "unknown option\n" );
usage();
return 1;
}
}
if( io_init( line ) < 0 ) {
return 1;
}
if( n_cmds > 0 ) {
for( i=0 ; i<n_cmds ; i++ ) {
sam7_handle_line( cmds[i] );
}
} else {
while( (cmdline = readline( "sam7> " )) ) {
add_history( cmdline );
sam7_handle_line( cmdline );
}
}
io_cleanup();
return 0;
}
static void usage( void )
{
printf( "usage: sam7 [options]\n" );
printf( " -e|--exec <cmd> execute cmd instead of entering interactive mode.\n");
printf( " -l|--line <line> specifies the line/tty which the boot agent resides.\n");
printf( " only used for posix IO.\n" );
printf( " -h|--help dislay this message and exit.\n");
}
static int sam7_parse_line( char *line, char *argv[] )
{
char *p = line;
int argc = 0;
while( *p ) {
// eat white space
while( *p && isspace( *p ) ) { p++; }
if( ! *p ) {
break;
}
argv[argc++] = p;
while( *p && !isspace( *p ) ) { p++; }
if( *p ) {
*p++ = '\0';
}
}
return argc;
}
static int sam7_handle_line( char *line )
{
int argc;
char buff[256];
char *argv[32];
cmd_t *cmd;
strncpy( buff, line, 255 );
buff[255] = '\0';
argc = sam7_parse_line( buff, argv );
if( argc > 0 ) {
if( (cmd = cmd_find( argv[0] )) != NULL ) {
return cmd->func( argc, argv );
}
printf( "command %s not found\n", argv[0] );
return -1;
}
return 0;
}
+357
View File
@@ -0,0 +1,357 @@
#! /bin/sh
# Common stub for a few missing GNU programs while installing.
scriptversion=2005-02-08.22
# Copyright (C) 1996, 1997, 1999, 2000, 2002, 2003, 2004, 2005
# 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., 59 Temple Place - Suite 330, Boston, MA
# 02111-1307, 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=:
# 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'
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 's/.*--output[ =]*\([^ ]*\).*/\1/p'`
test -z "$file" && file=`echo "$*" | sed -n 's/.*-o[ ]*\([^ ]*\).*/\1/p'`
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 [ $# -ne 1 ]; then
eval LASTARG="\${$#}"
case "$LASTARG" in
*.y)
SRCFILE=`echo "$LASTARG" | sed 's/y$/c/'`
if [ -f "$SRCFILE" ]; then
cp "$SRCFILE" y.tab.c
fi
SRCFILE=`echo "$LASTARG" | sed 's/y$/h/'`
if [ -f "$SRCFILE" ]; then
cp "$SRCFILE" y.tab.h
fi
;;
esac
fi
if [ ! -f y.tab.h ]; then
echo >y.tab.h
fi
if [ ! -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 [ $# -ne 1 ]; then
eval LASTARG="\${$#}"
case "$LASTARG" in
*.l)
SRCFILE=`echo "$LASTARG" | sed 's/l$/c/'`
if [ -f "$SRCFILE" ]; then
cp "$SRCFILE" lex.yy.c
fi
;;
esac
fi
if [ ! -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 's/.*-o \([^ ]*\).*/\1/p'`
if test -z "$file"; then
file=`echo "$*" | sed -n 's/.*--output=\([^ ]*\).*/\1/p'`
fi
if [ -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 's/.*-o \([^ ]*\).*/\1/p'`
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
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:
+373
View File
@@ -0,0 +1,373 @@
/*
* samba.c
*
* Copyright (C) 2005,2006 Erik Gilling, all rights reserved
*
* 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, version 2.
*
*/
#include "config.h"
#include <unistd.h>
#include <stdlib.h>
#include <stdio.h>
#include <string.h>
#include <errno.h>
#ifdef HAVE_ENDIAN_H
#include <endian.h>
#endif
#ifdef HAVE_LOCALENDIAN_H
#include <localendian.h>
#endif
#include "io.h"
#include "samba.h"
#ifndef __BYTE_ORDER
# define __LITTLE_ENDIAN 4321
# define __BIG_ENDIAN 1234
# ifdef __LITTLE_ENDIAN__
# define __BYTE_ORDER __LITTLE_ENDIAN
# endif
# ifdef __BIG_ENDIAN__
# define __BYTE_ORDER __BIG_ENDIAN
# endif
#endif
#if defined( __BYTE_ORDER )
# if __BYTE_ORDER == __LITTLE_ENDIAN
# define le2hl(x) (x)
# define le2hs(x) (x)
# endif
# if __BYTE_ORDER == __BIG_ENDIAN
# define le2hl(x) \
((unsigned long int)((((unsigned long int)(x) & 0x000000ffU) << 24) | \
(((unsigned long int)(x) & 0x0000ff00U) << 8) | \
(((unsigned long int)(x) & 0x00ff0000U) >> 8) | \
(((unsigned long int)(x) & 0xff000000U) >> 24)))
# define le2hs(x) \
((unsigned short int)((((unsigned short int)(x) & 0x00ff) << 8) | \
(((unsigned short int)(x) & 0xff00) >> 8)))
# endif
#endif
#define hl2le(x) le2hl(x)
#define hs2le(x) le2hs(x)
static const char *eprocs[] = {
/* 000 */ "",
/* 001 */ "ARM946E-S",
/* 010 */ "ARM7TDMI",
/* 011 */ "",
/* 100 */ "ARM920T",
/* 101 */ "ARM926EJ-S",
/* 110 */ "",
/* 111 */ ""
};
#define K 1024
static const int nvpsizs[] = {
/* 0000 */ 0,
/* 0001 */ 8 * K,
/* 0010 */ 16 * K,
/* 0011 */ 32 * K,
/* 0100 */ -1,
/* 0101 */ 64 * K,
/* 0110 */ -1,
/* 0111 */ 128 * K,
/* 1000 */ -1,
/* 1001 */ 256 * K,
/* 1010 */ 512 * K,
/* 1011 */ -1,
/* 1100 */ 1024 * K,
/* 1101 */ -1,
/* 1110 */ 2048 * K,
/* 1111 */ -1
};
static const int sramsizs[] = {
/* 0000 */ -1,
/* 0001 */ 1 * K,
/* 0010 */ 2 * K,
/* 0011 */ -1,
/* 0100 */ 112 * K,
/* 0101 */ 4 * K,
/* 0110 */ 80 * K,
/* 0111 */ 160 * K,
/* 1000 */ 8 * K,
/* 1001 */ 16 * K,
/* 1010 */ 32 * K,
/* 1011 */ 64 * K,
/* 1100 */ 128 * K,
/* 1101 */ 256 * K,
/* 1110 */ 96 * K,
/* 1111 */ 512 * K
};
static const struct { unsigned id; const char *name; } archs[] = {
{AT91_ARCH_AT75Cxx, "AT75Cxx"},
{AT91_ARCH_AT91x40, "AT91x40"},
{AT91_ARCH_AT91x63, "AT91x63"},
{AT91_ARCH_AT91x55, "AT91x55"},
{AT91_ARCH_AT91x42, "AT91x42"},
{AT91_ARCH_AT91x92, "AT91x92"},
{AT91_ARCH_AT91x34, "AT91x34"},
{AT91_ARCH_AT91SAM7Axx, "AT91SAM7Axx"},
{AT91_ARCH_AT91SAM7Sxx, "AT91SAM7Sxx"},
{AT91_ARCH_AT91SAM7XC, "AT91SAM7XC"},
{AT91_ARCH_AT91SAM7SExx, "AT91SAM7SExx"},
{AT91_ARCH_AT91SAM7Lxx, "AT91SAM7Lxx"},
{AT91_ARCH_AT91SAM7Xxx, "AT91SAM7Xxx"},
{AT91_ARCH_AT91SAM9xx, "AT91SAM9xx"}
};
static char arch_buffer[32];
const char *at91_arch_str( int id ) {
int i;
for( i=0 ; i<(sizeof(archs)/sizeof(*archs)) ; i++ ) {
if( archs[i].id == id ) {
return archs[i].name;
}
}
sprintf(arch_buffer,"unkown id [0x%02X]",id);
return arch_buffer;
}
at91_chip_info_t samba_chip_info;
int samba_init( void )
{
uint32_t chipid;
uint16_t response;
if( io_send_cmd( "N#", &response, sizeof( response ) ) < 0 ) {
printf( "can't init boot program: %s\n", strerror( errno ) );
return -1;
}
if( samba_read_word( 0xfffff240, &chipid ) < 0 ) {
return -1;
}
samba_chip_info.version = AT91_CHIPID_VERSION( chipid );
samba_chip_info.eproc = AT91_CHIPID_EPROC( chipid );
samba_chip_info.nvpsiz = nvpsizs[AT91_CHIPID_NVPSIZ( chipid )];
samba_chip_info.nvpsiz2 = nvpsizs[AT91_CHIPID_NVPSIZ2( chipid )];
samba_chip_info.sramsiz = sramsizs[AT91_CHIPID_SRAMSIZ( chipid )];
samba_chip_info.arch = AT91_CHIPID_ARCH( chipid );
if( samba_chip_info.arch == AT91_ARCH_AT91SAM7Sxx ) {
switch( samba_chip_info.nvpsiz) {
case 32*K:
samba_chip_info.page_size = 128;
samba_chip_info.lock_bits = 8;
break;
case 64*K:
samba_chip_info.page_size = 128;
samba_chip_info.lock_bits = 16;
break;
case 128*K:
samba_chip_info.page_size = 256;
samba_chip_info.lock_bits = 8;
break;
case 256*K:
samba_chip_info.page_size = 256;
samba_chip_info.lock_bits = 16;
break;
default:
printf( "unknown sam7s flash size %d\n", samba_chip_info.nvpsiz );
return -1;
}
} else if( samba_chip_info.arch == AT91_ARCH_AT91SAM7Xxx ) {
switch( samba_chip_info.nvpsiz ) {
case 128*K:
samba_chip_info.page_size = 256;
samba_chip_info.lock_bits = 8;
break;
case 256*K:
samba_chip_info.page_size = 256;
samba_chip_info.lock_bits = 16;
break;
default:
printf( "unknown sam7x srflashsize %d\n", samba_chip_info.nvpsiz );
return -1;
}
} else {
printf( "Page size info of %s not known\n",
at91_arch_str( samba_chip_info.arch ) );
return -1;
}
printf("Chip Version: %d\n", samba_chip_info.version );
printf("Embedded Processor: %s\n", eprocs[samba_chip_info.eproc] );
printf("NVRAM Region 1 Size: %d K\n", samba_chip_info.nvpsiz / K );
printf("NVRAM Region 2 Size: %d K\n", samba_chip_info.nvpsiz2 / K );
printf("SRAM Size: %d K\n", samba_chip_info.sramsiz / K );
printf("Series: %s\n", at91_arch_str( samba_chip_info.arch ) );
printf("Page Size: %d bytes\n", samba_chip_info.page_size );
printf("Lock Regions: %d\n", samba_chip_info.lock_bits );
return 0;
}
int samba_write_byte( uint32_t addr, uint8_t value )
{
char cmd[64];
snprintf( cmd, 64, "O%08X,%02X#", (unsigned int) addr,
(unsigned int) value );
return io_send_cmd( cmd, NULL, 0 );
}
int samba_read_byte( uint32_t addr, uint8_t *value )
{
char cmd[64];
snprintf( cmd, 64, "o%08X,1#", (unsigned int) addr );
return io_send_cmd( cmd, value, 1 );
}
int samba_write_half_word( uint32_t addr, uint16_t value )
{
char cmd[64];
snprintf( cmd, 64, "H%08X,%04X#", (unsigned int) addr,
(unsigned int) value );
return io_send_cmd( cmd, NULL, 0 );
}
int samba_read_half_word( uint32_t addr, uint16_t *value )
{
char cmd[64];
int err;
snprintf( cmd, 64, "h%X,2#", (unsigned int) addr );
err = io_send_cmd( cmd, value, 2 );
*value = le2hs( *value );
return err;
}
int samba_write_word( uint32_t addr, uint32_t value )
{
char cmd[64];
snprintf( cmd, 64, "W%08X,%08X#", (unsigned int) addr,
(unsigned int) value );
return io_send_cmd( cmd, NULL, 0 );
}
int samba_read_word( uint32_t addr, uint32_t *value )
{
char cmd[64];
int err;
snprintf( cmd, 64, "w%08X,4#", (unsigned int) addr );
err = io_send_cmd( cmd, value, 4 );
*value = le2hl( *value );
return err;
}
int samba_send_file( uint32_t addr, uint8_t *buff, int len )
{
char cmd[64];
int i=0;
snprintf( cmd, 64, "S%X,%X#", (unsigned int) addr, (unsigned int) len );
if( io_write( cmd, strlen( cmd ) ) < 0 ) {
return -1;
}
usleep( 2000 );
for( i=0 ; i<len ; i+=64 ) {
if( io_write( buff+i, (len-i < 64)? len-i : 64 ) < 0 ){
return -1;
}
usleep( 2000 );
}
return 0;
}
int samba_recv_file( uint32_t addr, uint8_t *buff, int len )
{
char cmd[64];
int i=0;
snprintf( cmd, 64, "R%X,%X#", (unsigned int) addr, (unsigned int) len );
if( io_write( cmd, strlen( cmd ) ) < 0 ) {
return -1;
}
usleep( 2000 );
for( i=0 ; i<len ; i+=64 ) {
if( io_read( buff+i, (len-i < 64)? len-i : 64 ) < 0 ){
return -1;
}
}
return 0;
}
int samba_go( uint32_t addr )
{
char cmd[64];
snprintf( cmd, 64, "G%08X#", (unsigned int) addr );
return io_send_cmd( cmd, NULL, 0 );
}
int samba_get_version( char *version, int len )
{
#if 0
if( io_send_cmd( "V#", version, len ) < 0 ) {
return -1;
}
return 0;
#else
/* don't know the new form of V# */
return -1;
#endif
}
+69
View File
@@ -0,0 +1,69 @@
/*
* samba.h
*
* Copyright (C) 2005 Erik Gilling, all rights reserved
*
* 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, version 2.
*
*/
#ifndef __samba_h__
#define __samba_h__
#ifdef HAVE_STDINT_H
#include <stdint.h>
#endif
#define AT91_CHIPID_VERSION( chipid ) (((chipid)>>0)&0x1f)
#define AT91_CHIPID_EPROC( chipid ) (((chipid)>>5)&0x7)
#define AT91_CHIPID_NVPSIZ( chipid ) (((chipid)>>8)&0xf)
#define AT91_CHIPID_NVPSIZ2( chipid ) (((chipid)>>12)&0xf)
#define AT91_CHIPID_SRAMSIZ( chipid ) (((chipid)>>16)&0xf)
#define AT91_CHIPID_ARCH( chipid ) (((chipid)>>20)&0xff)
#define AT91_CHIPID_NVPTYP( chipid ) (((chipid)>>28)&0x7)
#define AT91_CHIPID_EXT( chipid ) (((chipid)>>31)&0x1)
#define AT91_ARCH_AT75Cxx 0xF0
#define AT91_ARCH_AT91x40 0x40
#define AT91_ARCH_AT91x63 0x63
#define AT91_ARCH_AT91x55 0x55
#define AT91_ARCH_AT91x42 0x42
#define AT91_ARCH_AT91x92 0x92
#define AT91_ARCH_AT91x34 0x34
#define AT91_ARCH_AT91SAM7Axx 0x60
#define AT91_ARCH_AT91SAM7Sxx 0x70
#define AT91_ARCH_AT91SAM7XC 0x71
#define AT91_ARCH_AT91SAM7SExx 0x72
#define AT91_ARCH_AT91SAM7Lxx 0x73
#define AT91_ARCH_AT91SAM7Xxx 0x75
#define AT91_ARCH_AT91SAM9xx 0x19
typedef struct {
int version;
int eproc;
int nvpsiz;
int nvpsiz2;
int sramsiz;
int arch;
int page_size;
int lock_bits;
} at91_chip_info_t;
extern at91_chip_info_t samba_chip_info;
int samba_init( void );
int samba_write_byte( uint32_t addr, uint8_t value );
int samba_read_byte( uint32_t addr, uint8_t *value );
int samba_write_half_word( uint32_t addr, uint16_t value );
int samba_read_half_word( uint32_t addr, uint16_t *value );
int samba_write_word( uint32_t addr, uint32_t value );
int samba_read_word( uint32_t addr, uint32_t *value );
int samba_send_file( uint32_t addr, uint8_t *buff, int len );
int samba_recv_file( uint32_t addr, uint8_t *buff, int len );
int samba_go( uint32_t addr );
int samba_get_version( char *version, int len );
#endif /* __samba_h__ */
+1
View File
@@ -0,0 +1 @@
timestamp for config.h
+3
View File
@@ -0,0 +1,3 @@
int main(void)
{
}