Compare commits
19 Commits
Author | SHA1 | Date |
---|---|---|
Freddie Chopin | d9c4700b4d | |
Olivier Schonken | e69b94295e | |
Spencer Oliver | 6d1ea5a7a9 | |
Spencer Oliver | 8f944fc226 | |
Spencer Oliver | 6544018321 | |
Spencer Oliver | 80a9e44ac7 | |
Spencer Oliver | f5793f9a4a | |
Spencer Oliver | 6145b016c2 | |
Spencer Oliver | 2d0750d708 | |
Spencer Oliver | 00581ae591 | |
Spencer Oliver | f8a537aa92 | |
Spencer Oliver | feb926a770 | |
Spencer Oliver | 0c0c1b81e2 | |
Spencer Oliver | a384596034 | |
Spencer Oliver | 027f8c9fb3 | |
Spencer Oliver | 612cad7f7c | |
Spencer Oliver | 07a73c01d1 | |
Spencer Oliver | 6cb0c3ff14 | |
Freddie Chopin | f254667a13 |
|
@ -1,111 +0,0 @@
|
|||
# SPDX-License-Identifier: GPL-2.0-or-later
|
||||
|
||||
# Copyright (C) 2020 by Tarek BOUCHKATI <tarek.bouchkati@gmail.com>
|
||||
|
||||
on: push
|
||||
|
||||
name: OpenOCD Snapshot
|
||||
|
||||
jobs:
|
||||
package:
|
||||
runs-on: [ubuntu-18.04]
|
||||
env:
|
||||
DL_DIR: ../downloads
|
||||
BUILD_DIR: ../build
|
||||
steps:
|
||||
- name: Install needed packages
|
||||
run: |
|
||||
sudo apt-get update
|
||||
sudo apt-get install autotools-dev autoconf automake libtool pkg-config cmake texinfo texlive g++-mingw-w64-i686
|
||||
- name: Checkout Code
|
||||
uses: actions/checkout@v1
|
||||
- run: ./bootstrap
|
||||
- name: Prepare libusb1
|
||||
env:
|
||||
LIBUSB1_VER: 1.0.26
|
||||
run: |
|
||||
mkdir -p $DL_DIR && cd $DL_DIR
|
||||
wget "https://github.com/libusb/libusb/releases/download/v${LIBUSB1_VER}/libusb-${LIBUSB1_VER}.tar.bz2"
|
||||
tar -xjf libusb-${LIBUSB1_VER}.tar.bz2
|
||||
echo "LIBUSB1_SRC=$PWD/libusb-${LIBUSB1_VER}" >> $GITHUB_ENV
|
||||
- name: Prepare hidapi
|
||||
env:
|
||||
HIDAPI_VER: 0.11.2
|
||||
run: |
|
||||
mkdir -p $DL_DIR && cd $DL_DIR
|
||||
wget "https://github.com/libusb/hidapi/archive/hidapi-${HIDAPI_VER}.tar.gz"
|
||||
tar -xzf hidapi-${HIDAPI_VER}.tar.gz
|
||||
cd hidapi-hidapi-${HIDAPI_VER}
|
||||
./bootstrap
|
||||
echo "HIDAPI_SRC=$PWD" >> $GITHUB_ENV
|
||||
- name: Prepare libftdi
|
||||
env:
|
||||
LIBFTDI_VER: 1.5
|
||||
run: |
|
||||
mkdir -p $DL_DIR && cd $DL_DIR
|
||||
wget "http://www.intra2net.com/en/developer/libftdi/download/libftdi1-${LIBFTDI_VER}.tar.bz2"
|
||||
tar -xjf libftdi1-${LIBFTDI_VER}.tar.bz2
|
||||
echo "LIBFTDI_SRC=$PWD/libftdi1-${LIBFTDI_VER}" >> $GITHUB_ENV
|
||||
- name: Prepare capstone
|
||||
env:
|
||||
CAPSTONE_VER: 4.0.2
|
||||
run: |
|
||||
mkdir -p $DL_DIR && cd $DL_DIR
|
||||
CAPSTONE_NAME=${CAPSTONE_VER}
|
||||
CAPSTONE_FOLDER=capstone-${CAPSTONE_VER}
|
||||
wget "https://github.com/aquynh/capstone/archive/${CAPSTONE_VER}.tar.gz"
|
||||
tar -xzf ${CAPSTONE_VER}.tar.gz
|
||||
echo "CAPSTONE_SRC=$PWD/capstone-${CAPSTONE_VER}" >> $GITHUB_ENV
|
||||
- name: Package OpenOCD for windows
|
||||
env:
|
||||
MAKE_JOBS: 2
|
||||
HOST: i686-w64-mingw32
|
||||
LIBUSB1_CONFIG: --enable-shared --disable-static
|
||||
HIDAPI_CONFIG: --enable-shared --disable-static --disable-testgui
|
||||
LIBFTDI_CONFIG: -DSTATICLIBS=OFF -DEXAMPLES=OFF -DFTDI_EEPROM=OFF
|
||||
CAPSTONE_CONFIG: "CAPSTONE_BUILD_CORE_ONLY=yes CAPSTONE_STATIC=yes CAPSTONE_SHARED=no"
|
||||
run: |
|
||||
# check if there is tag pointing at HEAD, otherwise take the HEAD SHA-1 as OPENOCD_TAG
|
||||
OPENOCD_TAG="`git tag --points-at HEAD`"
|
||||
[ -z $OPENOCD_TAG ] && OPENOCD_TAG="`git rev-parse --short HEAD`"
|
||||
# check if there is tag pointing at HEAD, if so the release will have the same name as the tag,
|
||||
# otherwise it will be named 'latest'
|
||||
RELEASE_NAME="`git tag --points-at HEAD`"
|
||||
[ -z $RELEASE_NAME ] && RELEASE_NAME="latest"
|
||||
[[ $RELEASE_NAME = "latest" ]] && IS_PRE_RELEASE="true" || IS_PRE_RELEASE="false"
|
||||
# set env and call cross-build.sh
|
||||
export OPENOCD_TAG=$OPENOCD_TAG
|
||||
export OPENOCD_SRC=$PWD
|
||||
export OPENOCD_CONFIG=""
|
||||
mkdir -p $BUILD_DIR && cd $BUILD_DIR
|
||||
bash $OPENOCD_SRC/contrib/cross-build.sh $HOST
|
||||
# add missing dlls
|
||||
cd $HOST-root/usr
|
||||
cp `$HOST-gcc --print-file-name=libwinpthread-1.dll` ./bin/
|
||||
cp `$HOST-gcc --print-file-name=libgcc_s_sjlj-1.dll` ./bin/
|
||||
# prepare the artifact
|
||||
ARTIFACT="openocd-${OPENOCD_TAG}-${HOST}.tar.gz"
|
||||
tar -czf $ARTIFACT *
|
||||
echo "RELEASE_NAME=$RELEASE_NAME" >> $GITHUB_ENV
|
||||
echo "IS_PRE_RELEASE=$IS_PRE_RELEASE" >> $GITHUB_ENV
|
||||
echo "ARTIFACT_PATH=$PWD/$ARTIFACT" >> $GITHUB_ENV
|
||||
- name: Publish OpenOCD packaged for windows
|
||||
uses: actions/upload-artifact@v2
|
||||
with:
|
||||
path: ${{ env.ARTIFACT_PATH }}
|
||||
- name: Delete 'latest' Release
|
||||
uses: dev-drprasad/delete-tag-and-release@v0.2.0
|
||||
with:
|
||||
delete_release: true
|
||||
tag_name: ${{ env.RELEASE_NAME }}
|
||||
env:
|
||||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
||||
- name: Create Release
|
||||
uses: ncipollo/release-action@v1
|
||||
with:
|
||||
tag: ${{ env.RELEASE_NAME }}
|
||||
commit: ${{ github.sha }}
|
||||
draft: false
|
||||
artifacts: ${{ env.ARTIFACT_PATH }}
|
||||
prerelease: ${{ env.IS_PRE_RELEASE }}
|
||||
token: ${{ secrets.GITHUB_TOKEN }}
|
|
@ -3,7 +3,6 @@
|
|||
# build output
|
||||
.libs
|
||||
.deps
|
||||
.dirstamp
|
||||
*.o
|
||||
*.o.??????
|
||||
*.a
|
||||
|
@ -22,7 +21,7 @@ src/jtag/drivers/OpenULINK/*.lst
|
|||
src/jtag/drivers/OpenULINK/*.sym
|
||||
src/jtag/drivers/OpenULINK/*.map
|
||||
src/jtag/drivers/OpenULINK/*.mem
|
||||
src/jtag/drivers/OpenULINK/*.lk
|
||||
src/jtag/drivers/OpenULINK/*.lnk
|
||||
src/jtag/drivers/OpenULINK/*.ihx
|
||||
src/jtag/drivers/OpenULINK/*.rst
|
||||
|
||||
|
@ -30,8 +29,8 @@ src/jtag/drivers/OpenULINK/*.rst
|
|||
*.swp
|
||||
|
||||
src/startup.tcl
|
||||
startup_tcl.inc
|
||||
xscale_debug.inc
|
||||
startup_tcl.c
|
||||
xscale_debug.h
|
||||
|
||||
bin2char
|
||||
bin2char.exe
|
||||
|
@ -52,25 +51,27 @@ doc/openocd.pg
|
|||
doc/openocd.toc
|
||||
doc/openocd.tp
|
||||
doc/openocd.vr
|
||||
doc/texinfo.tex
|
||||
doc/version.texi
|
||||
src/openocd
|
||||
src/openocd.exe
|
||||
|
||||
# configure/autotools output
|
||||
/build-aux/
|
||||
aclocal.m4
|
||||
autom4te.cache
|
||||
config.h
|
||||
config.log
|
||||
config.status
|
||||
compile
|
||||
config.*
|
||||
configure
|
||||
depcomp
|
||||
doxygen
|
||||
doxygen.log
|
||||
Doxyfile
|
||||
install-sh
|
||||
libtool
|
||||
*-libtool
|
||||
ltmain.sh
|
||||
Makefile
|
||||
!contrib/loaders/**/Makefile
|
||||
mdate-sh
|
||||
missing
|
||||
stamp-h1
|
||||
stamp-vti
|
||||
INSTALL
|
||||
|
@ -93,11 +94,3 @@ TAGS
|
|||
|
||||
# CScope database files
|
||||
*cscope.out
|
||||
|
||||
# ctags tag files
|
||||
tags
|
||||
|
||||
# GNU Global tag files
|
||||
GPATH
|
||||
GRTAGS
|
||||
GTAGS
|
||||
|
|
|
@ -1,9 +1,6 @@
|
|||
[submodule "tools/git2cl"]
|
||||
path = tools/git2cl
|
||||
url = https://git.savannah.nongnu.org/git/git2cl.git
|
||||
url = http://repo.or.cz/r/git2cl.git
|
||||
[submodule "jimtcl"]
|
||||
path = jimtcl
|
||||
url = https://github.com/msteveb/jimtcl.git
|
||||
[submodule "src/jtag/drivers/libjaylink"]
|
||||
path = src/jtag/drivers/libjaylink
|
||||
url = https://gitlab.zapb.de/libjaylink/libjaylink.git
|
||||
url = http://repo.or.cz/r/jimtcl.git
|
||||
|
|
91
.travis.yml
91
.travis.yml
|
@ -1,91 +0,0 @@
|
|||
# SPDX-License-Identifier: GPL-2.0+
|
||||
# Copyright Marek Vasut <marex@denx.de>
|
||||
|
||||
# OpenOCD on Travis CI - https://travis-ci.org/
|
||||
|
||||
sudo: required
|
||||
dist: bionic
|
||||
|
||||
arch:
|
||||
- amd64
|
||||
- arm64
|
||||
- ppc64le
|
||||
- s390x
|
||||
|
||||
addons:
|
||||
apt:
|
||||
sources:
|
||||
- sourceline: 'ppa:ubuntu-toolchain-r/test'
|
||||
- sourceline: 'deb https://apt.llvm.org/bionic/ llvm-toolchain-bionic-9 main'
|
||||
key_url: 'https://apt.llvm.org/llvm-snapshot.gpg.key'
|
||||
packages:
|
||||
- libftdi-dev
|
||||
- libhidapi-dev
|
||||
- libjaylink-dev
|
||||
|
||||
env:
|
||||
- CC=gcc-9
|
||||
- CC=clang-9
|
||||
|
||||
language: c
|
||||
|
||||
git:
|
||||
depth: 1
|
||||
autocrlf: input
|
||||
|
||||
script:
|
||||
- $mingw64 ${CC} --version
|
||||
- $mingw64 env
|
||||
- $mingw64 ./bootstrap
|
||||
- $mingw64 ./configure
|
||||
- $mingw64 make
|
||||
|
||||
before_install:
|
||||
- |-
|
||||
case $TRAVIS_OS_NAME in
|
||||
linux)
|
||||
sudo apt install ${CC} libusb-1.0-0-dev
|
||||
;;
|
||||
osx)
|
||||
brew install libtool automake libusb libusb-compat hidapi libftdi
|
||||
;;
|
||||
windows)
|
||||
[[ ! -f C:/tools/msys64/msys2_shell.cmd ]] && rm -rf C:/tools/msys64
|
||||
choco uninstall -y mingw
|
||||
choco upgrade --no-progress -y msys2
|
||||
export msys2='cmd //C RefreshEnv.cmd '
|
||||
export msys2+='& set MSYS=winsymlinks:nativestrict '
|
||||
export msys2+='& C:\\tools\\msys64\\msys2_shell.cmd -defterm -no-start'
|
||||
export mingw64="$msys2 -mingw64 -full-path -here -c \$\* --"
|
||||
export msys2+=" -msys2 -c \$\* --"
|
||||
$msys2 pacman --sync --noconfirm --needed mingw-w64-x86_64-toolchain autoconf autoconf-archive automake automake-wrapper binutils gcc gettext git libtool m4 make pkg-config tcl texinfo mingw-w64-x86_64-libusb mingw-w64-x86_64-libusb-compat-git mingw-w64-x86_64-libjaylink-git mingw-w64-x86_64-libftdi mingw-w64-x86_64-hidapi mingw-w64-x86_64-clang
|
||||
## FIXME: Also build for i686?
|
||||
## Install more MSYS2 packages from https://packages.msys2.org/base here
|
||||
taskkill //IM gpg-agent.exe //F # https://travis-ci.community/t/4967
|
||||
export PATH=/C/tools/msys64/mingw64/bin:$PATH
|
||||
export MAKE=mingw32-make # so that Autotools can find it
|
||||
;;
|
||||
esac
|
||||
|
||||
before_cache:
|
||||
- |-
|
||||
case $TRAVIS_OS_NAME in
|
||||
windows)
|
||||
# https://unix.stackexchange.com/a/137322/107554
|
||||
$msys2 pacman --sync --clean --noconfirm
|
||||
;;
|
||||
esac
|
||||
|
||||
cache:
|
||||
directories:
|
||||
- $HOME/AppData/Local/Temp/chocolatey
|
||||
- /C/tools/msys64
|
||||
|
||||
matrix:
|
||||
include:
|
||||
- os: osx
|
||||
env:
|
||||
- CC=clang
|
||||
- os: windows
|
||||
env:
|
||||
- CC=gcc
|
4
BUGS
4
BUGS
|
@ -6,11 +6,11 @@ posting a message with your report:
|
|||
|
||||
openocd-devel@lists.sourceforge.net
|
||||
|
||||
Also, please check the bug database to see if a ticket for
|
||||
Also, please check the Trac bug database to see if a ticket for
|
||||
the bug has already been opened. You might be asked to open
|
||||
such a ticket, or to update an existing ticket with more data.
|
||||
|
||||
http://bugs.openocd.org/
|
||||
https://sourceforge.net/apps/trac/openocd/
|
||||
|
||||
To minimize work for OpenOCD developers, you should try to include
|
||||
all of the information listed below. If you feel that some of the
|
||||
|
|
342
COPYING
342
COPYING
|
@ -1,16 +1,340 @@
|
|||
OpenOCD is provided under:
|
||||
GNU GENERAL PUBLIC LICENSE
|
||||
Version 2, June 1991
|
||||
|
||||
SPDX-License-Identifier: GPL-2.0-or-later
|
||||
Copyright (C) 1989, 1991 Free Software Foundation, Inc.
|
||||
51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA
|
||||
Everyone is permitted to copy and distribute verbatim copies
|
||||
of this license document, but changing it is not allowed.
|
||||
|
||||
Being under the terms of the GNU General Public License version 2 or
|
||||
later, according with:
|
||||
Preamble
|
||||
|
||||
LICENSES/preferred/GPL-2.0
|
||||
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.
|
||||
|
||||
In addition, other licenses may also apply. Please see:
|
||||
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.
|
||||
|
||||
LICENSES/license-rules.txt
|
||||
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 more details.
|
||||
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.
|
||||
|
||||
All contributions to OpenOCD are subject to this COPYING file.
|
||||
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.
|
||||
|
|
10
Doxyfile.in
10
Doxyfile.in
|
@ -216,7 +216,7 @@ OPTIMIZE_OUTPUT_VHDL = NO
|
|||
# .inc files as Fortran files (default is PHP), and .f files as C (default is Fortran),
|
||||
# use: inc=Fortran f=C
|
||||
|
||||
EXTENSION_MAPPING = no_extension=C
|
||||
EXTENSION_MAPPING =
|
||||
|
||||
# If you use STL classes (i.e. std::string, std::vector, etc.) but do not want
|
||||
# to include (a tag file for) the STL sources as input, then you should
|
||||
|
@ -313,7 +313,7 @@ EXTRACT_STATIC = YES
|
|||
# defined locally in source files will be included in the documentation.
|
||||
# If set to NO only classes defined in header files are included.
|
||||
|
||||
EXTRACT_LOCAL_CLASSES = YES
|
||||
EXTRACT_LOCAL_CLASSES = NO
|
||||
|
||||
# This flag is only useful for Objective-C code. When set to YES local
|
||||
# methods, which are defined in the implementation section but not in
|
||||
|
@ -600,7 +600,7 @@ RECURSIVE = YES
|
|||
# excluded from the INPUT source files. This way you can easily exclude a
|
||||
# subdirectory from a directory tree whose root is specified with the INPUT tag.
|
||||
|
||||
EXCLUDE = @srcdir@/src/jtag/drivers/libjaylink
|
||||
EXCLUDE =
|
||||
|
||||
# The EXCLUDE_SYMLINKS tag can be used select whether or not files or
|
||||
# directories that are symbolic links (a Unix filesystem feature) are excluded
|
||||
|
@ -648,7 +648,7 @@ EXAMPLE_RECURSIVE = NO
|
|||
# directories that contain image that are included in the documentation (see
|
||||
# the \image command).
|
||||
|
||||
IMAGE_PATH = @srcdir@/doc/manual/images
|
||||
IMAGE_PATH =
|
||||
|
||||
# The INPUT_FILTER tag can be used to specify a program that doxygen should
|
||||
# invoke to filter for each input file. Doxygen will invoke the filter program
|
||||
|
@ -1234,7 +1234,7 @@ SEARCH_INCLUDES = YES
|
|||
# contain include files that are not input files but should be processed by
|
||||
# the preprocessor.
|
||||
|
||||
INCLUDE_PATH = @builddir@/src
|
||||
INCLUDE_PATH =
|
||||
|
||||
# You can use the INCLUDE_FILE_PATTERNS tag to specify one or more wildcard
|
||||
# patterns (like *.h and *.hpp) to filter out the header-files in the
|
||||
|
|
171
HACKING
171
HACKING
|
@ -1,20 +1,13 @@
|
|||
// This file is part of the Doxygen Developer Manual
|
||||
/** @page patchguide Patch Guidelines
|
||||
|
||||
\attention You can't send patches to the mailing list anymore at all. Nowadays
|
||||
@b NB! If you're behind a corporate wall with http only access to the
|
||||
world, you can still use these instructions!
|
||||
|
||||
@b NB2! You can't send patches to the mailing list anymore at all. Nowadays
|
||||
you are expected to send patches to the OpenOCD Gerrit GIT server for a
|
||||
review.
|
||||
|
||||
\attention If you already have a Gerrit account and want to try a
|
||||
different sign in method, please first sign in as usually, press your
|
||||
name in the upper-right corner, go to @a Settings, select @a
|
||||
Identities pane, press <em>Link Another Identity</em> button. In case
|
||||
you already have duplicated accounts, ask administrators for manual
|
||||
merging.
|
||||
|
||||
\attention If you're behind a corporate wall with http only access to the
|
||||
world, you can still use these instructions!
|
||||
|
||||
@section gerrit Submitting patches to the OpenOCD Gerrit server
|
||||
|
||||
OpenOCD is to some extent a "self service" open source project, so to
|
||||
|
@ -29,58 +22,12 @@ The procedure to create a patch is essentially:
|
|||
- correct the patch and re-send it according to review feedback
|
||||
|
||||
Your patch (or commit) should be a "good patch": focus it on a single
|
||||
issue, and make it easily reviewable. Don't make
|
||||
issue, and make it be easily reviewable. Don't make
|
||||
it so large that it's hard to review; split large
|
||||
patches into smaller ones (this will also help
|
||||
to track down bugs later). All patches should
|
||||
patches into smaller ones. (That can also help
|
||||
track down bugs later on.) All patches should
|
||||
be "clean", which includes preserving the existing
|
||||
coding style and updating documentation as needed. When adding a new
|
||||
command, the corresponding documentation should be added to
|
||||
@c doc/openocd.texi in the same commit. OpenOCD runs on both Little
|
||||
Endian and Big Endian hosts so the code can't count on specific byte
|
||||
ordering (in other words, must be endian-clean).
|
||||
|
||||
There are several additional methods of improving the quality of your
|
||||
patch:
|
||||
|
||||
- Runtime testing with Valgrind Memcheck
|
||||
|
||||
This helps to spot memory leaks, undefined behaviour due to
|
||||
uninitialized data or wrong indexing, memory corruption, etc.
|
||||
|
||||
- Clang Static Analyzer
|
||||
|
||||
Using this tool uncovers many different kinds of bugs in C code,
|
||||
with problematic execution paths fully explained. It is a part of
|
||||
standard Clang installation.
|
||||
|
||||
To generate a report, run this in the OpenOCD source directory:
|
||||
@code
|
||||
mkdir build-scanbuild; cd build-scanbuild
|
||||
scan-build ../configure
|
||||
scan-build make CFLAGS="-std=gnu99 -I. -I../../jimtcl"
|
||||
@endcode
|
||||
|
||||
- Runtime testing with sanitizers
|
||||
|
||||
Both GCC and LLVM/Clang include advanced instrumentation options to
|
||||
detect undefined behaviour and many kinds of memory
|
||||
errors. Available with @c -fsanitize=* command arguments.
|
||||
|
||||
Example usage:
|
||||
@code
|
||||
mkdir build-sanitizers; cd build-sanitizers
|
||||
../configure CC=clang CFLAGS="-fno-omit-frame-pointer \
|
||||
-fsanitize=address -fsanitize=undefined -ggdb3"
|
||||
make
|
||||
export ASAN_OPTIONS=detect_stack_use_after_return=1
|
||||
src/openocd -s ../tcl -f /path/to/openocd.cfg
|
||||
@endcode
|
||||
|
||||
Please consider performing these additional checks where appropriate
|
||||
(especially Clang Static Analyzer for big portions of new code) and
|
||||
mention the results (e.g. "Valgrind-clean, no new Clang analyzer
|
||||
warnings") in the commit message.
|
||||
coding style and updating documentation as needed.
|
||||
|
||||
Say in the commit message if it's a bugfix (describe the bug) or a new
|
||||
feature. Don't expect patches to merge immediately
|
||||
|
@ -91,7 +38,7 @@ Add yourself to the GPL copyright for non-trivial changes.
|
|||
|
||||
@section stepbystep Step by step procedure
|
||||
|
||||
-# Create a Gerrit account at: https://review.openocd.org
|
||||
-# Create a Gerrit account at: http://openocd.zylin.com
|
||||
- On subsequent sign ins, use the full URL prefaced with 'http://'
|
||||
For example: http://user_identifier.open_id_provider.com
|
||||
-# Add a username to your profile.
|
||||
|
@ -100,55 +47,40 @@ Add yourself to the GPL copyright for non-trivial changes.
|
|||
add a username of your choice.
|
||||
Your username will be required in step 3 and substituted wherever
|
||||
the string 'USERNAME' is found.
|
||||
-# Create an SSH public key following the directions on github:
|
||||
https://help.github.com/articles/generating-ssh-keys . You can skip step 3
|
||||
(adding key to Github account) and 4 (testing) - these are useful only if
|
||||
you actually use Github or want to test whether the new key works fine.
|
||||
-# Add this new SSH key to your Gerrit account:
|
||||
go to 'Settings' > 'SSH Public Keys', paste the contents of
|
||||
~/.ssh/id_rsa.pub into the text field (if it's not visible click on
|
||||
'Add Key ...' button) and confirm by clicking 'Add' button.
|
||||
-# Add an SSH public key following the directions on github:
|
||||
https://help.github.com/articles/generating-ssh-keys
|
||||
-# Clone the git repository, rather than just download the source:
|
||||
@code
|
||||
git clone git://git.code.sf.net/p/openocd/code openocd
|
||||
git clone git://openocd.git.sourceforge.net/gitroot/openocd/openocd
|
||||
@endcode
|
||||
or if you have problems with the "git:" protocol, use
|
||||
the slower http protocol:
|
||||
@code
|
||||
git clone http://git.code.sf.net/p/openocd/code openocd
|
||||
git clone http://repo.or.cz/r/openocd.git
|
||||
@endcode
|
||||
-# Set up Gerrit with your local repository. All this does it
|
||||
to instruct git locally how to send off the changes.
|
||||
-# Add a new remote to git using Gerrit username:
|
||||
@code
|
||||
git remote add review ssh://USERNAME@review.openocd.org:29418/openocd.git
|
||||
git config remote.review.push HEAD:refs/for/master
|
||||
git remote add review ssh://USERNAME@openocd.zylin.com:29418/openocd.git
|
||||
git config remote.review.push HEAD:refs/publish/master
|
||||
@endcode
|
||||
Or with http only:
|
||||
@code
|
||||
git remote add review https://USERNAME@review.openocd.org/p/openocd.git
|
||||
git config remote.review.push HEAD:refs/for/master
|
||||
git remote add review http://openocd.zylin.com/p/openocd.git
|
||||
git config remote.review.push HEAD:refs/publish/master
|
||||
@endcode
|
||||
The http password is configured from your gerrit settings - https://review.openocd.org/#/settings/http-password.
|
||||
\note If you want to simplify http access you can also add your http password to the url as follows:
|
||||
@code
|
||||
git remote add review https://USERNAME:PASSWORD@review.openocd.org/p/openocd.git
|
||||
@endcode
|
||||
\note All contributions should be pushed to @c refs/for/master on the
|
||||
Gerrit server, even if you plan to use several local branches for different
|
||||
topics. It is possible because @c for/master is not a traditional Git
|
||||
branch.
|
||||
-# You will need to install this hook, we will look into a better solution:
|
||||
@code
|
||||
scp -p -P 29418 USERNAME@review.openocd.org:hooks/commit-msg .git/hooks/
|
||||
scp -p -P 29418 USERNAME@openocd.zylin.com:hooks/commit-msg .git/hooks/
|
||||
@endcode
|
||||
Or with http only:
|
||||
@code
|
||||
wget https://review.openocd.org/tools/hooks/commit-msg
|
||||
wget http://openocd.zylin.com/tools/hooks/commit-msg
|
||||
mv commit-msg .git/hooks
|
||||
chmod +x .git/hooks/commit-msg
|
||||
@endcode
|
||||
\note A script exists to simplify the two items above. Execute:
|
||||
@b NOTE A script exists to simplify the two items above. execute:
|
||||
@code
|
||||
tools/initial.sh <username>
|
||||
@endcode
|
||||
|
@ -160,7 +92,7 @@ git config --global user.email "john@smith.org"
|
|||
@endcode
|
||||
-# Work on your patches. Split the work into
|
||||
multiple small patches that can be reviewed and
|
||||
applied separately and safely to the OpenOCD
|
||||
applied seperately and safely to the OpenOCD
|
||||
repository.
|
||||
@code
|
||||
while(!done) {
|
||||
|
@ -169,46 +101,17 @@ while(!done) {
|
|||
run tools/checkpatch.sh to verify your patch style is ok.
|
||||
}
|
||||
@endcode
|
||||
\note use "git add ." before commit to add new files.
|
||||
|
||||
Commit message template, notice the short first line.
|
||||
The field '<c>specify touched area</c>'
|
||||
should identify the main part or subsystem the patch touches.
|
||||
@code{.unparsed}
|
||||
specify touched area: short comment
|
||||
@b TIP! use "git add ." before commit to add new files.
|
||||
@code
|
||||
--- example comment, notice the short first line w/topic ---
|
||||
topic: short comment
|
||||
<blank line>
|
||||
Longer comments over several lines, explaining (where applicable) the
|
||||
reason for the patch and the general idea the solution is based on,
|
||||
any major design decisions, etc...
|
||||
longer comments over several
|
||||
lines...
|
||||
<blank line>
|
||||
Signed-off-by: ...
|
||||
-----
|
||||
@endcode
|
||||
Examples:
|
||||
@code{.unparsed}
|
||||
flash/nor/atsame5: add SAME59 support
|
||||
|
||||
Add new device ID
|
||||
@endcode
|
||||
@code{.unparsed}
|
||||
flash/nor: flash driver for XYZ123
|
||||
|
||||
Add new flash driver for internal flash of ...
|
||||
@endcode
|
||||
@code{.unparsed}
|
||||
target/cortex_m: fix segmentation fault in cmd 'soft_reset_halt'
|
||||
|
||||
soft_reset_halt command failed reproducibly under following conditions: ...
|
||||
Test for NULL pointer and return error ...
|
||||
|
||||
Reported-by: John Reporter <rep9876@gmail.com>
|
||||
Fixes: 123456789abc ("target: the commit where the problem started")
|
||||
BugLink: https://sourceforge.net/p/openocd/tickets/999/
|
||||
@endcode
|
||||
@code{.unparsed}
|
||||
doc: fix typos
|
||||
@endcode
|
||||
See "git log" for more examples.
|
||||
|
||||
-# Next you need to make sure that your patches
|
||||
are on top of the latest stuff on the server and
|
||||
that there are no conflicts:
|
||||
|
@ -231,7 +134,7 @@ Further reading: http://www.coreboot.org/Git
|
|||
|
||||
The code review is intended to take as long as a week or two to allow
|
||||
maintainers and contributors who work on OpenOCD only in their spare
|
||||
time opportunity to perform a review and raise objections.
|
||||
time oportunity to perform a review and raise objections.
|
||||
|
||||
With Gerrit much of the urgency of getting things committed has been
|
||||
removed as the work in progress is safely stored in Gerrit and
|
||||
|
@ -246,22 +149,8 @@ master branch will be much reduced.
|
|||
If a contributor pushes a patch, it is considered good form if another
|
||||
contributor actually approves and submits that patch.
|
||||
|
||||
It should be noted that a negative review in Gerrit ("-1" or "-2") may (but does
|
||||
not have to) be disregarded if all conditions listed below are met:
|
||||
|
||||
- the concerns raised in the review have been addressed (or explained),
|
||||
- reviewer does not re-examine the change in a month,
|
||||
- reviewer does not answer e-mails for another month.
|
||||
|
||||
@section browsing Browsing Patches
|
||||
All OpenOCD patches can be reviewed <a href="https://review.openocd.org/">here</a>.
|
||||
|
||||
@section reviewing Reviewing Patches
|
||||
From the main <a href="https://review.openocd.org/#/q/status:open,n,z">Review
|
||||
page</a> select the patch you want to review and click on that patch. On the
|
||||
appearing page select the download method (top right). Apply the
|
||||
patch. After building and testing you can leave a note with the "Reply"
|
||||
button and mark the patch with -1, 0 and +1.
|
||||
All OpenOCD patches can be reviewed <a href="http://openocd.zylin.com/">here</a>.
|
||||
*/
|
||||
/** @file
|
||||
This file contains the @ref patchguide page.
|
||||
|
|
|
@ -1,20 +0,0 @@
|
|||
SPDX-Exception-Identifier: eCos-exception-2.0
|
||||
SPDX-URL: https://spdx.org/licenses/eCos-exception-2.0.html
|
||||
SPDX-Licenses: GPL-2.0-only, GPL-2.0-or-later
|
||||
Usage-Guide:
|
||||
This exception is used together with one of the above SPDX-Licenses.
|
||||
To use this exception add it with the keyword WITH to one of the
|
||||
identifiers in the SPDX-Licenses tag:
|
||||
SPDX-License-Identifier: <SPDX-License> WITH eCos-exception-2.0
|
||||
License-Text:
|
||||
|
||||
As a special exception, if other files instantiate templates or use
|
||||
macros or inline functions from this file, or you compile this
|
||||
file and link it with other works to produce a work based on this
|
||||
file, this file does not by itself cause the resulting work to be
|
||||
covered by the GNU General Public License. However the source code for
|
||||
this file must still be made available in accordance with section (3)
|
||||
of the GNU General Public License.
|
||||
|
||||
This exception does not invalidate any other reasons why a work based on
|
||||
this file might be covered by the GNU General Public License.
|
|
@ -1,275 +0,0 @@
|
|||
# SPDX-License-Identifier: GPL-2.0-or-later OR GFDL-1.2-no-invariants-or-later
|
||||
|
||||
OpenOCD licensing rules
|
||||
=======================
|
||||
|
||||
The OpenOCD source code is provided under the terms of the GNU General
|
||||
Public License version 2 or later (GPL-2.0-or-later), as provided in
|
||||
LICENSES/preferred/GPL-2.0.
|
||||
|
||||
The OpenOCD documentation is provided under the terms of the GNU Free
|
||||
Documentation License version 1.2 or later without Invariant Sections
|
||||
(GFDL-1.2-no-invariants-or-later).
|
||||
|
||||
Few stand-alone applications coexist in the same code tree of OpenOCD
|
||||
and are provided under the terms of the GNU General Public License
|
||||
version 3 (GPL-3.0), as provided in LICENSES/stand-alone/GPL-3.0.
|
||||
|
||||
This documentation file provides a description of how each source file
|
||||
should be annotated to make its license clear and unambiguous.
|
||||
It doesn't replace the OpenOCD's license.
|
||||
|
||||
The license described in the COPYING file applies to the OpenOCD source
|
||||
as a whole, though individual source files can have a different license
|
||||
which is required to be compatible with the GPL-2.0:
|
||||
|
||||
GPL-1.0-or-later : GNU General Public License v1.0 or later
|
||||
GPL-2.0-or-later : GNU General Public License v2.0 or later
|
||||
LGPL-2.0 : GNU Library General Public License v2 only
|
||||
LGPL-2.0-or-later : GNU Library General Public License v2 or later
|
||||
LGPL-2.1 : GNU Lesser General Public License v2.1 only
|
||||
LGPL-2.1-or-later : GNU Lesser General Public License v2.1 or later
|
||||
|
||||
Aside from that, individual files can be provided under a dual license,
|
||||
e.g. one of the compatible GPL variants and alternatively under a
|
||||
permissive license like BSD, MIT etc.
|
||||
|
||||
The common way of expressing the license of a source file is to add the
|
||||
matching boilerplate text into the top comment of the file. Due to
|
||||
formatting, typos etc. these "boilerplates" are hard to validate for
|
||||
tools which are used in the context of license compliance.
|
||||
|
||||
An alternative to boilerplate text is the use of Software Package Data
|
||||
Exchange (SPDX) license identifiers in each source file. SPDX license
|
||||
identifiers are machine parsable and precise shorthands for the license
|
||||
under which the content of the file is contributed. SPDX license
|
||||
identifiers are managed by the SPDX Workgroup at the Linux Foundation and
|
||||
have been agreed on by partners throughout the industry, tool vendors, and
|
||||
legal teams. For further information see https://spdx.org/
|
||||
|
||||
OpenOCD requires the precise SPDX identifier in all source files.
|
||||
The valid identifiers used in OpenOCD are explained in the section
|
||||
`License identifiers` and have been retrieved from the official SPDX
|
||||
license list at https://spdx.org/licenses/ along with the license texts.
|
||||
|
||||
License identifier syntax
|
||||
-------------------------
|
||||
|
||||
1. Placement:
|
||||
|
||||
The SPDX license identifier in OpenOCD files shall be added at the
|
||||
first possible line in a file which can contain a comment. For the
|
||||
majority of files this is the first line, except for scripts which
|
||||
require the '#!PATH_TO_INTERPRETER' in the first line. For those
|
||||
scripts the SPDX identifier goes into the second line.
|
||||
|
||||
2. Style:
|
||||
|
||||
The SPDX license identifier is added in form of a comment. The comment
|
||||
style depends on the file type::
|
||||
|
||||
C source: // SPDX-License-Identifier: <SPDX License Expression>
|
||||
C header: /* SPDX-License-Identifier: <SPDX License Expression> */
|
||||
ASM: /* SPDX-License-Identifier: <SPDX License Expression> */
|
||||
makefiles: # SPDX-License-Identifier: <SPDX License Expression>
|
||||
scripts: # SPDX-License-Identifier: <SPDX License Expression>
|
||||
texinfo: @c SPDX-License-Identifier: <SPDX License Expression>
|
||||
text: # SPDX-License-Identifier: <SPDX License Expression>
|
||||
|
||||
If a specific tool cannot handle the standard comment style, then the
|
||||
appropriate comment mechanism which the tool accepts shall be used. This
|
||||
is the reason for having the "/\* \*/" style comment in C header
|
||||
files. There was build breakage observed with generated .lds files where
|
||||
'ld' failed to parse the C++ comment. This has been fixed by now, but
|
||||
there are still older assembler tools which cannot handle C++ style
|
||||
comments.
|
||||
|
||||
3. Syntax:
|
||||
|
||||
A <SPDX License Expression> is either an SPDX short form license
|
||||
identifier found on the SPDX License List, or the combination of two
|
||||
SPDX short form license identifiers separated by "WITH" when a license
|
||||
exception applies. When multiple licenses apply, an expression consists
|
||||
of keywords "AND", "OR" separating sub-expressions and surrounded by
|
||||
"(", ")" .
|
||||
|
||||
License identifiers for licenses like [L]GPL with the 'or later' option
|
||||
are constructed by using a "-or-later":
|
||||
|
||||
// SPDX-License-Identifier: GPL-2.0-or-later
|
||||
// SPDX-License-Identifier: LGPL-2.1-or-later
|
||||
|
||||
WITH should be used when there is a modifier to a license needed.
|
||||
Exceptions can only be used with particular License identifiers. The
|
||||
valid License identifiers are listed in the tags of the exception text
|
||||
file.
|
||||
|
||||
OR should be used if the file is dual licensed and only one license is
|
||||
to be selected. For example, some source files are available under dual
|
||||
licenses:
|
||||
|
||||
// SPDX-License-Identifier: GPL-2.0-or-later OR BSD-1-Clause
|
||||
// SPDX-License-Identifier: GPL-2.0-or-later OR BSD-2-Clause
|
||||
// SPDX-License-Identifier: GPL-2.0-or-later OR BSD-3-Clause
|
||||
|
||||
AND should be used if the file has multiple licenses whose terms all
|
||||
apply to use the file. For example, if code is inherited from another
|
||||
project and permission has been given to put it in OpenOCD, but the
|
||||
original license terms need to remain in effect::
|
||||
|
||||
// SPDX-License-Identifier: GPL-2.0-or-later AND MIT
|
||||
|
||||
License identifiers
|
||||
-------------------
|
||||
|
||||
The licenses currently used, as well as the licenses for code added to
|
||||
OpenOCD, can be broken down into:
|
||||
|
||||
1. `Preferred licenses`:
|
||||
|
||||
Whenever possible these licenses should be used as they are known to be
|
||||
fully compatible and widely used. These licenses are available from the
|
||||
directory:
|
||||
|
||||
LICENSES/preferred/
|
||||
|
||||
in the OpenOCD source tree.
|
||||
|
||||
The files in this directory contain the full license text and
|
||||
`Metatags`. The file names are identical to the SPDX license
|
||||
identifier which shall be used for the license in source files.
|
||||
|
||||
Examples:
|
||||
|
||||
LICENSES/preferred/GPL-2.0
|
||||
|
||||
Contains the GPL version 2 license text and the required metatags.
|
||||
|
||||
`Metatags`:
|
||||
|
||||
The following meta tags must be available in a license file:
|
||||
|
||||
- Valid-License-Identifier:
|
||||
|
||||
One or more lines which declare which License Identifiers are valid
|
||||
inside the project to reference this particular license text. Usually
|
||||
this is a single valid identifier, but e.g. for licenses with the 'or
|
||||
later' options two identifiers are valid.
|
||||
|
||||
- SPDX-URL:
|
||||
|
||||
The URL of the SPDX page which contains additional information related
|
||||
to the license.
|
||||
|
||||
- Usage-Guidance:
|
||||
|
||||
Freeform text for usage advice. The text must include correct examples
|
||||
for the SPDX license identifiers as they should be put into source
|
||||
files according to the `License identifier syntax` guidelines.
|
||||
|
||||
- License-Text:
|
||||
|
||||
All text after this tag is treated as the original license text
|
||||
|
||||
File format examples::
|
||||
|
||||
Valid-License-Identifier: GPL-2.0
|
||||
Valid-License-Identifier: GPL-2.0-only
|
||||
Valid-License-Identifier: GPL-2.0-or-later
|
||||
SPDX-URL: https://spdx.org/licenses/GPL-2.0.html
|
||||
Usage-Guide:
|
||||
To use this license in source code, put one of the following SPDX
|
||||
tag/value pairs into a comment according to the placement
|
||||
guidelines in the licensing rules documentation.
|
||||
For 'GNU General Public License (GPL) version 2 only' use:
|
||||
SPDX-License-Identifier: GPL-2.0
|
||||
or
|
||||
SPDX-License-Identifier: GPL-2.0-only
|
||||
For 'GNU General Public License (GPL) version 2 or any later version' use:
|
||||
SPDX-License-Identifier: GPL-2.0-or-later
|
||||
License-Text:
|
||||
Full license text
|
||||
|
||||
2. Exceptions:
|
||||
|
||||
Some licenses can be amended with exceptions which grant certain rights
|
||||
which the original license does not. These exceptions are available
|
||||
from the directory::
|
||||
|
||||
LICENSES/exceptions/
|
||||
|
||||
in the OpenOCD source tree. The files in this directory contain the full
|
||||
exception text and the required `Exception Metatags`_.
|
||||
|
||||
Examples::
|
||||
|
||||
LICENSES/exceptions/eCos-exception-2.0
|
||||
|
||||
Exception Metatags:
|
||||
|
||||
The following meta tags must be available in an exception file:
|
||||
|
||||
- SPDX-Exception-Identifier:
|
||||
|
||||
One exception identifier which can be used with SPDX license
|
||||
identifiers.
|
||||
|
||||
- SPDX-URL:
|
||||
|
||||
The URL of the SPDX page which contains additional information related
|
||||
to the exception.
|
||||
|
||||
- SPDX-Licenses:
|
||||
|
||||
A comma separated list of SPDX license identifiers for which the
|
||||
exception can be used.
|
||||
|
||||
- Usage-Guidance:
|
||||
|
||||
Freeform text for usage advice. The text must be followed by correct
|
||||
examples for the SPDX license identifiers as they should be put into
|
||||
source files according to the `License identifier syntax`_ guidelines.
|
||||
|
||||
- Exception-Text:
|
||||
|
||||
All text after this tag is treated as the original exception text
|
||||
|
||||
File format examples::
|
||||
|
||||
SPDX-Exception-Identifier: eCos-exception-2.0
|
||||
SPDX-URL: https://spdx.org/licenses/eCos-exception-2.0.html
|
||||
SPDX-Licenses: GPL-2.0-only, GPL-2.0-or-later
|
||||
Usage-Guide:
|
||||
This exception is used together with one of the above SPDX-Licenses.
|
||||
To use this exception add it with the keyword WITH to one of the
|
||||
identifiers in the SPDX-Licenses tag:
|
||||
SPDX-License-Identifier: <SPDX-License> WITH eCos-exception-2.0
|
||||
License-Text:
|
||||
Full license text
|
||||
|
||||
3. Stand-alone licenses:
|
||||
|
||||
These licenses should only be used for stand-alone applications that are
|
||||
distributed with OpenOCD but are not included in the OpenOCD binary.
|
||||
These licenses are available from the directory:
|
||||
|
||||
LICENSES/stand-alone/
|
||||
|
||||
in the OpenOCD source tree.
|
||||
|
||||
Examples:
|
||||
|
||||
SPDX-License-Identifier: GPL-3.0
|
||||
|
||||
The format and requirements of the license files in the other sub-directories
|
||||
of directory
|
||||
|
||||
LICENSES
|
||||
|
||||
have to follow the same format and requirements of the `Preferred licenses`.
|
||||
|
||||
All SPDX license identifiers and exceptions must have a corresponding file
|
||||
in the LICENSES subdirectories. This is required to allow tool
|
||||
verification (e.g. checkpatch.pl) and to have the licenses ready to read
|
||||
and extract right from the source, which is recommended by various FOSS
|
||||
organizations, e.g. the `FSFE REUSE initiative <https://reuse.software/>`.
|
|
@ -1,28 +0,0 @@
|
|||
Valid-License-Identifier: BSD-1-Clause
|
||||
SPDX-URL: https://spdx.org/licenses/BSD-1-Clause.html
|
||||
Usage-Guide:
|
||||
To use the BSD 1-clause License put the following SPDX
|
||||
tag/value pair into a comment according to the placement guidelines in
|
||||
the licensing rules documentation:
|
||||
SPDX-License-Identifier: BSD-1-Clause
|
||||
License-Text:
|
||||
|
||||
Copyright (c) <year> <owner> . All rights reserved.
|
||||
|
||||
Redistribution and use in source and binary forms, with or without
|
||||
modification, are permitted provided that the following conditions are met:
|
||||
|
||||
1. Redistributions of source code must retain the above copyright notice,
|
||||
this list of conditions and the following disclaimer.
|
||||
|
||||
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
|
||||
AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
|
||||
IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
|
||||
ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
|
||||
LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
|
||||
CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
|
||||
SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
|
||||
INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
|
||||
CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
|
||||
ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
|
||||
POSSIBILITY OF SUCH DAMAGE.
|
|
@ -1,32 +0,0 @@
|
|||
Valid-License-Identifier: BSD-2-Clause
|
||||
SPDX-URL: https://spdx.org/licenses/BSD-2-Clause.html
|
||||
Usage-Guide:
|
||||
To use the BSD 2-clause "Simplified" License put the following SPDX
|
||||
tag/value pair into a comment according to the placement guidelines in
|
||||
the licensing rules documentation:
|
||||
SPDX-License-Identifier: BSD-2-Clause
|
||||
License-Text:
|
||||
|
||||
Copyright (c) <year> <owner> . All rights reserved.
|
||||
|
||||
Redistribution and use in source and binary forms, with or without
|
||||
modification, are permitted provided that the following conditions are met:
|
||||
|
||||
1. Redistributions of source code must retain the above copyright notice,
|
||||
this list of conditions and the following disclaimer.
|
||||
|
||||
2. Redistributions in binary form must reproduce the above copyright
|
||||
notice, this list of conditions and the following disclaimer in the
|
||||
documentation and/or other materials provided with the distribution.
|
||||
|
||||
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
|
||||
AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
|
||||
IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
|
||||
ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
|
||||
LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
|
||||
CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
|
||||
SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
|
||||
INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
|
||||
CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
|
||||
ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
|
||||
POSSIBILITY OF SUCH DAMAGE.
|
|
@ -1,37 +0,0 @@
|
|||
Valid-License-Identifier: BSD-2-Clause-Views
|
||||
SPDX-URL: https://spdx.org/licenses/BSD-2-Clause-Views.html
|
||||
Usage-Guide:
|
||||
To use the BSD 2-clause with views sentence License put the following SPDX
|
||||
tag/value pair into a comment according to the placement guidelines in
|
||||
the licensing rules documentation:
|
||||
SPDX-License-Identifier: BSD-2-Clause-Views
|
||||
License-Text:
|
||||
|
||||
Copyright (c) <year> <owner> . All rights reserved.
|
||||
|
||||
Redistribution and use in source and binary forms, with or without
|
||||
modification, are permitted provided that the following conditions are met:
|
||||
|
||||
1. Redistributions of source code must retain the above copyright notice,
|
||||
this list of conditions and the following disclaimer.
|
||||
|
||||
2. Redistributions in binary form must reproduce the above copyright
|
||||
notice, this list of conditions and the following disclaimer in the
|
||||
documentation and/or other materials provided with the distribution.
|
||||
|
||||
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
|
||||
AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
|
||||
IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
|
||||
ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
|
||||
LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
|
||||
CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
|
||||
SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
|
||||
INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
|
||||
CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
|
||||
ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
|
||||
POSSIBILITY OF SUCH DAMAGE.
|
||||
|
||||
The views and conclusions contained in the software and documentation
|
||||
are those of the authors and should not be interpreted as representing
|
||||
official policies, either expressed or implied, of the copyright holders
|
||||
or contributors.
|
|
@ -1,36 +0,0 @@
|
|||
Valid-License-Identifier: BSD-3-Clause
|
||||
SPDX-URL: https://spdx.org/licenses/BSD-3-Clause.html
|
||||
Usage-Guide:
|
||||
To use the BSD 3-clause "New" or "Revised" License put the following SPDX
|
||||
tag/value pair into a comment according to the placement guidelines in
|
||||
the licensing rules documentation:
|
||||
SPDX-License-Identifier: BSD-3-Clause
|
||||
License-Text:
|
||||
|
||||
Copyright (c) <year> <owner> . All rights reserved.
|
||||
|
||||
Redistribution and use in source and binary forms, with or without
|
||||
modification, are permitted provided that the following conditions are met:
|
||||
|
||||
1. Redistributions of source code must retain the above copyright notice,
|
||||
this list of conditions and the following disclaimer.
|
||||
|
||||
2. Redistributions in binary form must reproduce the above copyright
|
||||
notice, this list of conditions and the following disclaimer in the
|
||||
documentation and/or other materials provided with the distribution.
|
||||
|
||||
3. Neither the name of the copyright holder nor the names of its
|
||||
contributors may be used to endorse or promote products derived from this
|
||||
software without specific prior written permission.
|
||||
|
||||
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
|
||||
AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
|
||||
IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
|
||||
ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
|
||||
LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
|
||||
CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
|
||||
SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
|
||||
INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
|
||||
CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
|
||||
ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
|
||||
POSSIBILITY OF SUCH DAMAGE.
|
|
@ -1,32 +0,0 @@
|
|||
Valid-License-Identifier: BSD-Source-Code
|
||||
SPDX-URL: https://spdx.org/licenses/BSD-Source-Code.html
|
||||
Usage-Guide:
|
||||
To use the BSD Source Code Attribution License put the following SPDX
|
||||
tag/value pair into a comment according to the placement guidelines in
|
||||
the licensing rules documentation:
|
||||
SPDX-License-Identifier: BSD-Source-Code
|
||||
License-Text:
|
||||
|
||||
Copyright (c) <year> <owner> . All rights reserved.
|
||||
|
||||
Redistribution and use of this software in source and binary forms, with or without
|
||||
modification, are permitted provided that the following conditions are met:
|
||||
|
||||
* Redistributions of source code must retain the above copyright notice,
|
||||
this list of conditions and the following disclaimer.
|
||||
|
||||
* Neither the name of the copyright holder nor the names of its
|
||||
contributors may be used to endorse or promote products derived from this
|
||||
software without specific prior written permission.
|
||||
|
||||
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
|
||||
AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
|
||||
IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
|
||||
ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
|
||||
LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
|
||||
CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
|
||||
SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
|
||||
INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
|
||||
CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
|
||||
ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
|
||||
POSSIBILITY OF SUCH DAMAGE.
|
|
@ -1,412 +0,0 @@
|
|||
Valid-License-Identifier: GPL-2.0-or-later OR GFDL-1.2-no-invariants-or-later
|
||||
Valid-License-Identifier: GFDL-1.2-no-invariants-or-later
|
||||
SPDX-URL: https://spdx.org/licenses/GFDL-1.2-no-invariants-or-later.html
|
||||
Usage-Guide:
|
||||
The GNU Free Documentation License should only be used without
|
||||
Invariant Sections, Front-Cover Texts or Back-Cover Texts.
|
||||
It should not be used for new documents.
|
||||
To use the license in source code, put the following SPDX tag/value pair
|
||||
into a comment according to the placement guidelines in the licensing
|
||||
rules documentation:
|
||||
SPDX-License-Identifier: GPL-2.0-or-later OR GFDL-1.2-no-invariants-or-later
|
||||
or
|
||||
SPDX-License-Identifier: GFDL-1.2-no-invariants-or-later
|
||||
License-Text:
|
||||
|
||||
GNU Free Documentation License
|
||||
Version 1.2, November 2002
|
||||
|
||||
|
||||
Copyright (C) 2000,2001,2002 Free Software Foundation, Inc.
|
||||
51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
|
||||
Everyone is permitted to copy and distribute verbatim copies
|
||||
of this license document, but changing it is not allowed.
|
||||
|
||||
|
||||
0. PREAMBLE
|
||||
|
||||
The purpose of this License is to make a manual, textbook, or other
|
||||
functional and useful document "free" in the sense of freedom: to
|
||||
assure everyone the effective freedom to copy and redistribute it,
|
||||
with or without modifying it, either commercially or noncommercially.
|
||||
Secondarily, this License preserves for the author and publisher a way
|
||||
to get credit for their work, while not being considered responsible
|
||||
for modifications made by others.
|
||||
|
||||
This License is a kind of "copyleft", which means that derivative
|
||||
works of the document must themselves be free in the same sense. It
|
||||
complements the GNU General Public License, which is a copyleft
|
||||
license designed for free software.
|
||||
|
||||
We have designed this License in order to use it for manuals for free
|
||||
software, because free software needs free documentation: a free
|
||||
program should come with manuals providing the same freedoms that the
|
||||
software does. But this License is not limited to software manuals;
|
||||
it can be used for any textual work, regardless of subject matter or
|
||||
whether it is published as a printed book. We recommend this License
|
||||
principally for works whose purpose is instruction or reference.
|
||||
|
||||
|
||||
1. APPLICABILITY AND DEFINITIONS
|
||||
|
||||
This License applies to any manual or other work, in any medium, that
|
||||
contains a notice placed by the copyright holder saying it can be
|
||||
distributed under the terms of this License. Such a notice grants a
|
||||
world-wide, royalty-free license, unlimited in duration, to use that
|
||||
work under the conditions stated herein. The "Document", below,
|
||||
refers to any such manual or work. Any member of the public is a
|
||||
licensee, and is addressed as "you". You accept the license if you
|
||||
copy, modify or distribute the work in a way requiring permission
|
||||
under copyright law.
|
||||
|
||||
A "Modified Version" of the Document means any work containing the
|
||||
Document or a portion of it, either copied verbatim, or with
|
||||
modifications and/or translated into another language.
|
||||
|
||||
A "Secondary Section" is a named appendix or a front-matter section of
|
||||
the Document that deals exclusively with the relationship of the
|
||||
publishers or authors of the Document to the Document's overall subject
|
||||
(or to related matters) and contains nothing that could fall directly
|
||||
within that overall subject. (Thus, if the Document is in part a
|
||||
textbook of mathematics, a Secondary Section may not explain any
|
||||
mathematics.) The relationship could be a matter of historical
|
||||
connection with the subject or with related matters, or of legal,
|
||||
commercial, philosophical, ethical or political position regarding
|
||||
them.
|
||||
|
||||
The "Invariant Sections" are certain Secondary Sections whose titles
|
||||
are designated, as being those of Invariant Sections, in the notice
|
||||
that says that the Document is released under this License. If a
|
||||
section does not fit the above definition of Secondary then it is not
|
||||
allowed to be designated as Invariant. The Document may contain zero
|
||||
Invariant Sections. If the Document does not identify any Invariant
|
||||
Sections then there are none.
|
||||
|
||||
The "Cover Texts" are certain short passages of text that are listed,
|
||||
as Front-Cover Texts or Back-Cover Texts, in the notice that says that
|
||||
the Document is released under this License. A Front-Cover Text may
|
||||
be at most 5 words, and a Back-Cover Text may be at most 25 words.
|
||||
|
||||
A "Transparent" copy of the Document means a machine-readable copy,
|
||||
represented in a format whose specification is available to the
|
||||
general public, that is suitable for revising the document
|
||||
straightforwardly with generic text editors or (for images composed of
|
||||
pixels) generic paint programs or (for drawings) some widely available
|
||||
drawing editor, and that is suitable for input to text formatters or
|
||||
for automatic translation to a variety of formats suitable for input
|
||||
to text formatters. A copy made in an otherwise Transparent file
|
||||
format whose markup, or absence of markup, has been arranged to thwart
|
||||
or discourage subsequent modification by readers is not Transparent.
|
||||
An image format is not Transparent if used for any substantial amount
|
||||
of text. A copy that is not "Transparent" is called "Opaque".
|
||||
|
||||
Examples of suitable formats for Transparent copies include plain
|
||||
ASCII without markup, Texinfo input format, LaTeX input format, SGML
|
||||
or XML using a publicly available DTD, and standard-conforming simple
|
||||
HTML, PostScript or PDF designed for human modification. Examples of
|
||||
transparent image formats include PNG, XCF and JPG. Opaque formats
|
||||
include proprietary formats that can be read and edited only by
|
||||
proprietary word processors, SGML or XML for which the DTD and/or
|
||||
processing tools are not generally available, and the
|
||||
machine-generated HTML, PostScript or PDF produced by some word
|
||||
processors for output purposes only.
|
||||
|
||||
The "Title Page" means, for a printed book, the title page itself,
|
||||
plus such following pages as are needed to hold, legibly, the material
|
||||
this License requires to appear in the title page. For works in
|
||||
formats which do not have any title page as such, "Title Page" means
|
||||
the text near the most prominent appearance of the work's title,
|
||||
preceding the beginning of the body of the text.
|
||||
|
||||
A section "Entitled XYZ" means a named subunit of the Document whose
|
||||
title either is precisely XYZ or contains XYZ in parentheses following
|
||||
text that translates XYZ in another language. (Here XYZ stands for a
|
||||
specific section name mentioned below, such as "Acknowledgements",
|
||||
"Dedications", "Endorsements", or "History".) To "Preserve the Title"
|
||||
of such a section when you modify the Document means that it remains a
|
||||
section "Entitled XYZ" according to this definition.
|
||||
|
||||
The Document may include Warranty Disclaimers next to the notice which
|
||||
states that this License applies to the Document. These Warranty
|
||||
Disclaimers are considered to be included by reference in this
|
||||
License, but only as regards disclaiming warranties: any other
|
||||
implication that these Warranty Disclaimers may have is void and has
|
||||
no effect on the meaning of this License.
|
||||
|
||||
|
||||
2. VERBATIM COPYING
|
||||
|
||||
You may copy and distribute the Document in any medium, either
|
||||
commercially or noncommercially, provided that this License, the
|
||||
copyright notices, and the license notice saying this License applies
|
||||
to the Document are reproduced in all copies, and that you add no other
|
||||
conditions whatsoever to those of this License. You may not use
|
||||
technical measures to obstruct or control the reading or further
|
||||
copying of the copies you make or distribute. However, you may accept
|
||||
compensation in exchange for copies. If you distribute a large enough
|
||||
number of copies you must also follow the conditions in section 3.
|
||||
|
||||
You may also lend copies, under the same conditions stated above, and
|
||||
you may publicly display copies.
|
||||
|
||||
|
||||
3. COPYING IN QUANTITY
|
||||
|
||||
If you publish printed copies (or copies in media that commonly have
|
||||
printed covers) of the Document, numbering more than 100, and the
|
||||
Document's license notice requires Cover Texts, you must enclose the
|
||||
copies in covers that carry, clearly and legibly, all these Cover
|
||||
Texts: Front-Cover Texts on the front cover, and Back-Cover Texts on
|
||||
the back cover. Both covers must also clearly and legibly identify
|
||||
you as the publisher of these copies. The front cover must present
|
||||
the full title with all words of the title equally prominent and
|
||||
visible. You may add other material on the covers in addition.
|
||||
Copying with changes limited to the covers, as long as they preserve
|
||||
the title of the Document and satisfy these conditions, can be treated
|
||||
as verbatim copying in other respects.
|
||||
|
||||
If the required texts for either cover are too voluminous to fit
|
||||
legibly, you should put the first ones listed (as many as fit
|
||||
reasonably) on the actual cover, and continue the rest onto adjacent
|
||||
pages.
|
||||
|
||||
If you publish or distribute Opaque copies of the Document numbering
|
||||
more than 100, you must either include a machine-readable Transparent
|
||||
copy along with each Opaque copy, or state in or with each Opaque copy
|
||||
a computer-network location from which the general network-using
|
||||
public has access to download using public-standard network protocols
|
||||
a complete Transparent copy of the Document, free of added material.
|
||||
If you use the latter option, you must take reasonably prudent steps,
|
||||
when you begin distribution of Opaque copies in quantity, to ensure
|
||||
that this Transparent copy will remain thus accessible at the stated
|
||||
location until at least one year after the last time you distribute an
|
||||
Opaque copy (directly or through your agents or retailers) of that
|
||||
edition to the public.
|
||||
|
||||
It is requested, but not required, that you contact the authors of the
|
||||
Document well before redistributing any large number of copies, to give
|
||||
them a chance to provide you with an updated version of the Document.
|
||||
|
||||
|
||||
4. MODIFICATIONS
|
||||
|
||||
You may copy and distribute a Modified Version of the Document under
|
||||
the conditions of sections 2 and 3 above, provided that you release
|
||||
the Modified Version under precisely this License, with the Modified
|
||||
Version filling the role of the Document, thus licensing distribution
|
||||
and modification of the Modified Version to whoever possesses a copy
|
||||
of it. In addition, you must do these things in the Modified Version:
|
||||
|
||||
A. Use in the Title Page (and on the covers, if any) a title distinct
|
||||
from that of the Document, and from those of previous versions
|
||||
(which should, if there were any, be listed in the History section
|
||||
of the Document). You may use the same title as a previous version
|
||||
if the original publisher of that version gives permission.
|
||||
B. List on the Title Page, as authors, one or more persons or entities
|
||||
responsible for authorship of the modifications in the Modified
|
||||
Version, together with at least five of the principal authors of the
|
||||
Document (all of its principal authors, if it has fewer than five),
|
||||
unless they release you from this requirement.
|
||||
C. State on the Title page the name of the publisher of the
|
||||
Modified Version, as the publisher.
|
||||
D. Preserve all the copyright notices of the Document.
|
||||
E. Add an appropriate copyright notice for your modifications
|
||||
adjacent to the other copyright notices.
|
||||
F. Include, immediately after the copyright notices, a license notice
|
||||
giving the public permission to use the Modified Version under the
|
||||
terms of this License, in the form shown in the Addendum below.
|
||||
G. Preserve in that license notice the full lists of Invariant Sections
|
||||
and required Cover Texts given in the Document's license notice.
|
||||
H. Include an unaltered copy of this License.
|
||||
I. Preserve the section Entitled "History", Preserve its Title, and add
|
||||
to it an item stating at least the title, year, new authors, and
|
||||
publisher of the Modified Version as given on the Title Page. If
|
||||
there is no section Entitled "History" in the Document, create one
|
||||
stating the title, year, authors, and publisher of the Document as
|
||||
given on its Title Page, then add an item describing the Modified
|
||||
Version as stated in the previous sentence.
|
||||
J. Preserve the network location, if any, given in the Document for
|
||||
public access to a Transparent copy of the Document, and likewise
|
||||
the network locations given in the Document for previous versions
|
||||
it was based on. These may be placed in the "History" section.
|
||||
You may omit a network location for a work that was published at
|
||||
least four years before the Document itself, or if the original
|
||||
publisher of the version it refers to gives permission.
|
||||
K. For any section Entitled "Acknowledgements" or "Dedications",
|
||||
Preserve the Title of the section, and preserve in the section all
|
||||
the substance and tone of each of the contributor acknowledgements
|
||||
and/or dedications given therein.
|
||||
L. Preserve all the Invariant Sections of the Document,
|
||||
unaltered in their text and in their titles. Section numbers
|
||||
or the equivalent are not considered part of the section titles.
|
||||
M. Delete any section Entitled "Endorsements". Such a section
|
||||
may not be included in the Modified Version.
|
||||
N. Do not retitle any existing section to be Entitled "Endorsements"
|
||||
or to conflict in title with any Invariant Section.
|
||||
O. Preserve any Warranty Disclaimers.
|
||||
|
||||
If the Modified Version includes new front-matter sections or
|
||||
appendices that qualify as Secondary Sections and contain no material
|
||||
copied from the Document, you may at your option designate some or all
|
||||
of these sections as invariant. To do this, add their titles to the
|
||||
list of Invariant Sections in the Modified Version's license notice.
|
||||
These titles must be distinct from any other section titles.
|
||||
|
||||
You may add a section Entitled "Endorsements", provided it contains
|
||||
nothing but endorsements of your Modified Version by various
|
||||
parties--for example, statements of peer review or that the text has
|
||||
been approved by an organization as the authoritative definition of a
|
||||
standard.
|
||||
|
||||
You may add a passage of up to five words as a Front-Cover Text, and a
|
||||
passage of up to 25 words as a Back-Cover Text, to the end of the list
|
||||
of Cover Texts in the Modified Version. Only one passage of
|
||||
Front-Cover Text and one of Back-Cover Text may be added by (or
|
||||
through arrangements made by) any one entity. If the Document already
|
||||
includes a cover text for the same cover, previously added by you or
|
||||
by arrangement made by the same entity you are acting on behalf of,
|
||||
you may not add another; but you may replace the old one, on explicit
|
||||
permission from the previous publisher that added the old one.
|
||||
|
||||
The author(s) and publisher(s) of the Document do not by this License
|
||||
give permission to use their names for publicity for or to assert or
|
||||
imply endorsement of any Modified Version.
|
||||
|
||||
|
||||
5. COMBINING DOCUMENTS
|
||||
|
||||
You may combine the Document with other documents released under this
|
||||
License, under the terms defined in section 4 above for modified
|
||||
versions, provided that you include in the combination all of the
|
||||
Invariant Sections of all of the original documents, unmodified, and
|
||||
list them all as Invariant Sections of your combined work in its
|
||||
license notice, and that you preserve all their Warranty Disclaimers.
|
||||
|
||||
The combined work need only contain one copy of this License, and
|
||||
multiple identical Invariant Sections may be replaced with a single
|
||||
copy. If there are multiple Invariant Sections with the same name but
|
||||
different contents, make the title of each such section unique by
|
||||
adding at the end of it, in parentheses, the name of the original
|
||||
author or publisher of that section if known, or else a unique number.
|
||||
Make the same adjustment to the section titles in the list of
|
||||
Invariant Sections in the license notice of the combined work.
|
||||
|
||||
In the combination, you must combine any sections Entitled "History"
|
||||
in the various original documents, forming one section Entitled
|
||||
"History"; likewise combine any sections Entitled "Acknowledgements",
|
||||
and any sections Entitled "Dedications". You must delete all sections
|
||||
Entitled "Endorsements".
|
||||
|
||||
|
||||
6. COLLECTIONS OF DOCUMENTS
|
||||
|
||||
You may make a collection consisting of the Document and other documents
|
||||
released under this License, and replace the individual copies of this
|
||||
License in the various documents with a single copy that is included in
|
||||
the collection, provided that you follow the rules of this License for
|
||||
verbatim copying of each of the documents in all other respects.
|
||||
|
||||
You may extract a single document from such a collection, and distribute
|
||||
it individually under this License, provided you insert a copy of this
|
||||
License into the extracted document, and follow this License in all
|
||||
other respects regarding verbatim copying of that document.
|
||||
|
||||
|
||||
7. AGGREGATION WITH INDEPENDENT WORKS
|
||||
|
||||
A compilation of the Document or its derivatives with other separate
|
||||
and independent documents or works, in or on a volume of a storage or
|
||||
distribution medium, is called an "aggregate" if the copyright
|
||||
resulting from the compilation is not used to limit the legal rights
|
||||
of the compilation's users beyond what the individual works permit.
|
||||
When the Document is included in an aggregate, this License does not
|
||||
apply to the other works in the aggregate which are not themselves
|
||||
derivative works of the Document.
|
||||
|
||||
If the Cover Text requirement of section 3 is applicable to these
|
||||
copies of the Document, then if the Document is less than one half of
|
||||
the entire aggregate, the Document's Cover Texts may be placed on
|
||||
covers that bracket the Document within the aggregate, or the
|
||||
electronic equivalent of covers if the Document is in electronic form.
|
||||
Otherwise they must appear on printed covers that bracket the whole
|
||||
aggregate.
|
||||
|
||||
|
||||
8. TRANSLATION
|
||||
|
||||
Translation is considered a kind of modification, so you may
|
||||
distribute translations of the Document under the terms of section 4.
|
||||
Replacing Invariant Sections with translations requires special
|
||||
permission from their copyright holders, but you may include
|
||||
translations of some or all Invariant Sections in addition to the
|
||||
original versions of these Invariant Sections. You may include a
|
||||
translation of this License, and all the license notices in the
|
||||
Document, and any Warranty Disclaimers, provided that you also include
|
||||
the original English version of this License and the original versions
|
||||
of those notices and disclaimers. In case of a disagreement between
|
||||
the translation and the original version of this License or a notice
|
||||
or disclaimer, the original version will prevail.
|
||||
|
||||
If a section in the Document is Entitled "Acknowledgements",
|
||||
"Dedications", or "History", the requirement (section 4) to Preserve
|
||||
its Title (section 1) will typically require changing the actual
|
||||
title.
|
||||
|
||||
|
||||
9. TERMINATION
|
||||
|
||||
You may not copy, modify, sublicense, or distribute the Document except
|
||||
as expressly provided for under this License. Any other attempt to
|
||||
copy, modify, sublicense or distribute the Document 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.
|
||||
|
||||
|
||||
10. FUTURE REVISIONS OF THIS LICENSE
|
||||
|
||||
The Free Software Foundation may publish new, revised versions
|
||||
of the GNU Free Documentation 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. See
|
||||
https://www.gnu.org/licenses/.
|
||||
|
||||
Each version of the License is given a distinguishing version number.
|
||||
If the Document specifies that a particular numbered version of this
|
||||
License "or any later version" applies to it, you have the option of
|
||||
following the terms and conditions either of that specified version or
|
||||
of any later version that has been published (not as a draft) by the
|
||||
Free Software Foundation. If the Document does not specify a version
|
||||
number of this License, you may choose any version ever published (not
|
||||
as a draft) by the Free Software Foundation.
|
||||
|
||||
|
||||
ADDENDUM: How to use this License for your documents
|
||||
|
||||
To use this License in a document you have written, include a copy of
|
||||
the License in the document and put the following copyright and
|
||||
license notices just after the title page:
|
||||
|
||||
Copyright (c) YEAR YOUR NAME.
|
||||
Permission is granted to copy, distribute and/or modify this document
|
||||
under the terms of the GNU Free Documentation License, Version 1.2
|
||||
or any later version published by the Free Software Foundation;
|
||||
with no Invariant Sections, no Front-Cover Texts, and no Back-Cover Texts.
|
||||
A copy of the license is included in the section entitled "GNU
|
||||
Free Documentation License".
|
||||
|
||||
If you have Invariant Sections, Front-Cover Texts and Back-Cover Texts,
|
||||
replace the "with...Texts." line with this:
|
||||
|
||||
with the Invariant Sections being LIST THEIR TITLES, with the
|
||||
Front-Cover Texts being LIST, and with the Back-Cover Texts being LIST.
|
||||
|
||||
If you have Invariant Sections without Cover Texts, or some other
|
||||
combination of the three, merge those two alternatives to suit the
|
||||
situation.
|
||||
|
||||
If your document contains nontrivial examples of program code, we
|
||||
recommend releasing these examples in parallel under your choice of
|
||||
free software license, such as the GNU General Public License,
|
||||
to permit their use in free software.
|
|
@ -1,355 +0,0 @@
|
|||
Valid-License-Identifier: GPL-2.0
|
||||
Valid-License-Identifier: GPL-2.0-only
|
||||
Valid-License-Identifier: GPL-2.0-or-later
|
||||
SPDX-URL: https://spdx.org/licenses/GPL-2.0.html
|
||||
Usage-Guide:
|
||||
To use this license in source code, put one of the following SPDX
|
||||
tag/value pairs into a comment according to the placement
|
||||
guidelines in the licensing rules documentation.
|
||||
For 'GNU General Public License (GPL) version 2 only' use:
|
||||
SPDX-License-Identifier: GPL-2.0
|
||||
or
|
||||
SPDX-License-Identifier: GPL-2.0-only
|
||||
For 'GNU General Public License (GPL) version 2 or any later version' use:
|
||||
SPDX-License-Identifier: GPL-2.0-or-later
|
||||
License-Text:
|
||||
|
||||
GNU GENERAL PUBLIC LICENSE
|
||||
Version 2, June 1991
|
||||
|
||||
Copyright (C) 1989, 1991 Free Software Foundation, Inc.,
|
||||
51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
|
||||
Everyone is permitted to copy and distribute verbatim copies
|
||||
of this license document, but changing it is not allowed.
|
||||
|
||||
Preamble
|
||||
|
||||
The licenses for most software are designed to take away your
|
||||
freedom to share and change it. By contrast, the GNU General Public
|
||||
License is intended to guarantee your freedom to share and change free
|
||||
software--to make sure the software is free for all its users. This
|
||||
General Public License applies to most of the Free Software
|
||||
Foundation's software and to any other program whose authors commit to
|
||||
using it. (Some other Free Software Foundation software is covered by
|
||||
the GNU Lesser General Public License instead.) You can apply it to
|
||||
your programs, too.
|
||||
|
||||
When we speak of free software, we are referring to freedom, not
|
||||
price. Our General Public Licenses are designed to make sure that you
|
||||
have the freedom to distribute copies of free software (and charge for
|
||||
this service if you wish), that you receive source code or can get it
|
||||
if you want it, that you can change the software or use pieces of it
|
||||
in new free programs; and that you know you can do these things.
|
||||
|
||||
To protect your rights, we need to make restrictions that forbid
|
||||
anyone to deny you these rights or to ask you to surrender the rights.
|
||||
These restrictions translate to certain responsibilities for you if you
|
||||
distribute copies of the software, or if you modify it.
|
||||
|
||||
For example, if you distribute copies of such a program, whether
|
||||
gratis or for a fee, you must give the recipients all the rights that
|
||||
you have. You must make sure that they, too, receive or can get the
|
||||
source code. And you must show them these terms so they know their
|
||||
rights.
|
||||
|
||||
We protect your rights with two steps: (1) copyright the software, and
|
||||
(2) offer you this license which gives you legal permission to copy,
|
||||
distribute and/or modify the software.
|
||||
|
||||
Also, for each author's protection and ours, we want to make certain
|
||||
that everyone understands that there is no warranty for this free
|
||||
software. If the software is modified by someone else and passed on, we
|
||||
want its recipients to know that what they have is not the original, so
|
||||
that any problems introduced by others will not reflect on the original
|
||||
authors' reputations.
|
||||
|
||||
Finally, any free program is threatened constantly by software
|
||||
patents. We wish to avoid the danger that redistributors of a free
|
||||
program will individually obtain patent licenses, in effect making the
|
||||
program proprietary. To prevent this, we have made it clear that any
|
||||
patent must be licensed for everyone's free use or not licensed at all.
|
||||
|
||||
The precise terms and conditions for copying, distribution and
|
||||
modification follow.
|
||||
|
||||
GNU GENERAL PUBLIC LICENSE
|
||||
TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION
|
||||
|
||||
0. This License applies to any program or other work which contains
|
||||
a notice placed by the copyright holder saying it may be distributed
|
||||
under the terms of this General Public License. The "Program", below,
|
||||
refers to any such program or work, and a "work based on the Program"
|
||||
means either the Program or any derivative work under copyright law:
|
||||
that is to say, a work containing the Program or a portion of it,
|
||||
either verbatim or with modifications and/or translated into another
|
||||
language. (Hereinafter, translation is included without limitation in
|
||||
the term "modification".) Each licensee is addressed as "you".
|
||||
|
||||
Activities other than copying, distribution and modification are not
|
||||
covered by this License; they are outside its scope. The act of
|
||||
running the Program is not restricted, and the output from the Program
|
||||
is covered only if its contents constitute a work based on the
|
||||
Program (independent of having been made by running the Program).
|
||||
Whether that is true depends on what the Program does.
|
||||
|
||||
1. You may copy and distribute verbatim copies of the Program's
|
||||
source code as you receive it, in any medium, provided that you
|
||||
conspicuously and appropriately publish on each copy an appropriate
|
||||
copyright notice and disclaimer of warranty; keep intact all the
|
||||
notices that refer to this License and to the absence of any warranty;
|
||||
and give any other recipients of the Program a copy of this License
|
||||
along with the Program.
|
||||
|
||||
You may charge a fee for the physical act of transferring a copy, and
|
||||
you may at your option offer warranty protection in exchange for a fee.
|
||||
|
||||
2. You may modify your copy or copies of the Program or any portion
|
||||
of it, thus forming a work based on the Program, and copy and
|
||||
distribute such modifications or work under the terms of Section 1
|
||||
above, provided that you also meet all of these conditions:
|
||||
|
||||
a) You must cause the modified files to carry prominent notices
|
||||
stating that you changed the files and the date of any change.
|
||||
|
||||
b) You must cause any work that you distribute or publish, that in
|
||||
whole or in part contains or is derived from the Program or any
|
||||
part thereof, to be licensed as a whole at no charge to all third
|
||||
parties under the terms of this License.
|
||||
|
||||
c) If the modified program normally reads commands interactively
|
||||
when run, you must cause it, when started running for such
|
||||
interactive use in the most ordinary way, to print or display an
|
||||
announcement including an appropriate copyright notice and a
|
||||
notice that there is no warranty (or else, saying that you provide
|
||||
a warranty) and that users may redistribute the program under
|
||||
these conditions, and telling the user how to view a copy of this
|
||||
License. (Exception: if the Program itself is interactive but
|
||||
does not normally print such an announcement, your work based on
|
||||
the Program is not required to print an announcement.)
|
||||
|
||||
These requirements apply to the modified work as a whole. If
|
||||
identifiable sections of that work are not derived from the Program,
|
||||
and can be reasonably considered independent and separate works in
|
||||
themselves, then this License, and its terms, do not apply to those
|
||||
sections when you distribute them as separate works. But when you
|
||||
distribute the same sections as part of a whole which is a work based
|
||||
on the Program, the distribution of the whole must be on the terms of
|
||||
this License, whose permissions for other licensees extend to the
|
||||
entire whole, and thus to each and every part regardless of who wrote it.
|
||||
|
||||
Thus, it is not the intent of this section to claim rights or contest
|
||||
your rights to work written entirely by you; rather, the intent is to
|
||||
exercise the right to control the distribution of derivative or
|
||||
collective works based on the Program.
|
||||
|
||||
In addition, mere aggregation of another work not based on the Program
|
||||
with the Program (or with a work based on the Program) on a volume of
|
||||
a storage or distribution medium does not bring the other work under
|
||||
the scope of this License.
|
||||
|
||||
3. You may copy and distribute the Program (or a work based on it,
|
||||
under Section 2) in object code or executable form under the terms of
|
||||
Sections 1 and 2 above provided that you also do one of the following:
|
||||
|
||||
a) Accompany it with the complete corresponding machine-readable
|
||||
source code, which must be distributed under the terms of Sections
|
||||
1 and 2 above on a medium customarily used for software interchange; or,
|
||||
|
||||
b) Accompany it with a written offer, valid for at least three
|
||||
years, to give any third party, for a charge no more than your
|
||||
cost of physically performing source distribution, a complete
|
||||
machine-readable copy of the corresponding source code, to be
|
||||
distributed under the terms of Sections 1 and 2 above on a medium
|
||||
customarily used for software interchange; or,
|
||||
|
||||
c) Accompany it with the information you received as to the offer
|
||||
to distribute corresponding source code. (This alternative is
|
||||
allowed only for noncommercial distribution and only if you
|
||||
received the program in object code or executable form with such
|
||||
an offer, in accord with Subsection b above.)
|
||||
|
||||
The source code for a work means the preferred form of the work for
|
||||
making modifications to it. For an executable work, complete source
|
||||
code means all the source code for all modules it contains, plus any
|
||||
associated interface definition files, plus the scripts used to
|
||||
control compilation and installation of the executable. However, as a
|
||||
special exception, the source code distributed need not include
|
||||
anything that is normally distributed (in either source or binary
|
||||
form) with the major components (compiler, kernel, and so on) of the
|
||||
operating system on which the executable runs, unless that component
|
||||
itself accompanies the executable.
|
||||
|
||||
If distribution of executable or object code is made by offering
|
||||
access to copy from a designated place, then offering equivalent
|
||||
access to copy the source code from the same place counts as
|
||||
distribution of the source code, even though third parties are not
|
||||
compelled to copy the source along with the object code.
|
||||
|
||||
4. You may not copy, modify, sublicense, or distribute the Program
|
||||
except as expressly provided under this License. Any attempt
|
||||
otherwise to copy, modify, sublicense or distribute the Program is
|
||||
void, and will automatically terminate your rights under this License.
|
||||
However, parties who have received copies, or rights, from you under
|
||||
this License will not have their licenses terminated so long as such
|
||||
parties remain in full compliance.
|
||||
|
||||
5. You are not required to accept this License, since you have not
|
||||
signed it. However, nothing else grants you permission to modify or
|
||||
distribute the Program or its derivative works. These actions are
|
||||
prohibited by law if you do not accept this License. Therefore, by
|
||||
modifying or distributing the Program (or any work based on the
|
||||
Program), you indicate your acceptance of this License to do so, and
|
||||
all its terms and conditions for copying, distributing or modifying
|
||||
the Program or works based on it.
|
||||
|
||||
6. Each time you redistribute the Program (or any work based on the
|
||||
Program), the recipient automatically receives a license from the
|
||||
original licensor to copy, distribute or modify the Program subject to
|
||||
these terms and conditions. You may not impose any further
|
||||
restrictions on the recipients' exercise of the rights granted herein.
|
||||
You are not responsible for enforcing compliance by third parties to
|
||||
this License.
|
||||
|
||||
7. If, as a consequence of a court judgment or allegation of patent
|
||||
infringement or for any other reason (not limited to patent issues),
|
||||
conditions are imposed on you (whether by court order, agreement or
|
||||
otherwise) that contradict the conditions of this License, they do not
|
||||
excuse you from the conditions of this License. If you cannot
|
||||
distribute so as to satisfy simultaneously your obligations under this
|
||||
License and any other pertinent obligations, then as a consequence you
|
||||
may not distribute the Program at all. For example, if a patent
|
||||
license would not permit royalty-free redistribution of the Program by
|
||||
all those who receive copies directly or indirectly through you, then
|
||||
the only way you could satisfy both it and this License would be to
|
||||
refrain entirely from distribution of the Program.
|
||||
|
||||
If any portion of this section is held invalid or unenforceable under
|
||||
any particular circumstance, the balance of the section is intended to
|
||||
apply and the section as a whole is intended to apply in other
|
||||
circumstances.
|
||||
|
||||
It is not the purpose of this section to induce you to infringe any
|
||||
patents or other property right claims or to contest validity of any
|
||||
such claims; this section has the sole purpose of protecting the
|
||||
integrity of the free software distribution system, which is
|
||||
implemented by public license practices. Many people have made
|
||||
generous contributions to the wide range of software distributed
|
||||
through that system in reliance on consistent application of that
|
||||
system; it is up to the author/donor to decide if he or she is willing
|
||||
to distribute software through any other system and a licensee cannot
|
||||
impose that choice.
|
||||
|
||||
This section is intended to make thoroughly clear what is believed to
|
||||
be a consequence of the rest of this License.
|
||||
|
||||
8. If the distribution and/or use of the Program is restricted in
|
||||
certain countries either by patents or by copyrighted interfaces, the
|
||||
original copyright holder who places the Program under this License
|
||||
may add an explicit geographical distribution limitation excluding
|
||||
those countries, so that distribution is permitted only in or among
|
||||
countries not thus excluded. In such case, this License incorporates
|
||||
the limitation as if written in the body of this License.
|
||||
|
||||
9. The Free Software Foundation may publish revised and/or new versions
|
||||
of the General Public License from time to time. Such new versions will
|
||||
be similar in spirit to the present version, but may differ in detail to
|
||||
address new problems or concerns.
|
||||
|
||||
Each version is given a distinguishing version number. If the Program
|
||||
specifies a version number of this License which applies to it and "any
|
||||
later version", you have the option of following the terms and conditions
|
||||
either of that version or of any later version published by the Free
|
||||
Software Foundation. If the Program does not specify a version number of
|
||||
this License, you may choose any version ever published by the Free Software
|
||||
Foundation.
|
||||
|
||||
10. If you wish to incorporate parts of the Program into other free
|
||||
programs whose distribution conditions are different, write to the author
|
||||
to ask for permission. For software which is copyrighted by the Free
|
||||
Software Foundation, write to the Free Software Foundation; we sometimes
|
||||
make exceptions for this. Our decision will be guided by the two goals
|
||||
of preserving the free status of all derivatives of our free software and
|
||||
of promoting the sharing and reuse of software generally.
|
||||
|
||||
NO WARRANTY
|
||||
|
||||
11. BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY
|
||||
FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN
|
||||
OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES
|
||||
PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED
|
||||
OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
|
||||
MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS
|
||||
TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU. SHOULD THE
|
||||
PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING,
|
||||
REPAIR OR CORRECTION.
|
||||
|
||||
12. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING
|
||||
WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR
|
||||
REDISTRIBUTE THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES,
|
||||
INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING
|
||||
OUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED
|
||||
TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY
|
||||
YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER
|
||||
PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE
|
||||
POSSIBILITY OF SUCH DAMAGES.
|
||||
|
||||
END OF TERMS AND CONDITIONS
|
||||
|
||||
How to Apply These Terms to Your New Programs
|
||||
|
||||
If you develop a new program, and you want it to be of the greatest
|
||||
possible use to the public, the best way to achieve this is to make it
|
||||
free software which everyone can redistribute and change under these terms.
|
||||
|
||||
To do so, attach the following notices to the program. It is safest
|
||||
to attach them to the start of each source file to most effectively
|
||||
convey the exclusion of warranty; and each file should have at least
|
||||
the "copyright" line and a pointer to where the full notice is found.
|
||||
|
||||
<one line to give the program's name and a brief idea of what it does.>
|
||||
Copyright (C) <year> <name of author>
|
||||
|
||||
This program is free software; you can redistribute it and/or modify
|
||||
it under the terms of the GNU General Public License as published by
|
||||
the Free Software Foundation; either version 2 of the License, or
|
||||
(at your option) any later version.
|
||||
|
||||
This program is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
GNU General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU General Public License along
|
||||
with this program; if not, write to the Free Software Foundation, Inc.,
|
||||
51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
|
||||
|
||||
Also add information on how to contact you by electronic and paper mail.
|
||||
|
||||
If the program is interactive, make it output a short notice like this
|
||||
when it starts in an interactive mode:
|
||||
|
||||
Gnomovision version 69, Copyright (C) year name of author
|
||||
Gnomovision comes with ABSOLUTELY NO WARRANTY; for details type `show w'.
|
||||
This is free software, and you are welcome to redistribute it
|
||||
under certain conditions; type `show c' for details.
|
||||
|
||||
The hypothetical commands `show w' and `show c' should show the appropriate
|
||||
parts of the General Public License. Of course, the commands you use may
|
||||
be called something other than `show w' and `show c'; they could even be
|
||||
mouse-clicks or menu items--whatever suits your program.
|
||||
|
||||
You should also get your employer (if you work as a programmer) or your
|
||||
school, if any, to sign a "copyright disclaimer" for the program, if
|
||||
necessary. Here is a sample; alter the names:
|
||||
|
||||
Yoyodyne, Inc., hereby disclaims all copyright interest in the program
|
||||
`Gnomovision' (which makes passes at compilers) written by James Hacker.
|
||||
|
||||
<signature of Ty Coon>, 1 April 1989
|
||||
Ty Coon, President of Vice
|
||||
|
||||
This General Public License does not permit incorporating your program into
|
||||
proprietary programs. If your program is a subroutine library, you may
|
||||
consider it more useful to permit linking proprietary applications with the
|
||||
library. If this is what you want to do, use the GNU Lesser General
|
||||
Public License instead of this License.
|
|
@ -1,30 +0,0 @@
|
|||
Valid-License-Identifier: MIT
|
||||
SPDX-URL: https://spdx.org/licenses/MIT.html
|
||||
Usage-Guide:
|
||||
To use the MIT License put the following SPDX tag/value pair into a
|
||||
comment according to the placement guidelines in the licensing rules
|
||||
documentation:
|
||||
SPDX-License-Identifier: MIT
|
||||
License-Text:
|
||||
|
||||
MIT License
|
||||
|
||||
Copyright (c) <year> <copyright holders>
|
||||
|
||||
Permission is hereby granted, free of charge, to any person obtaining a
|
||||
copy of this software and associated documentation files (the "Software"),
|
||||
to deal in the Software without restriction, including without limitation
|
||||
the rights to use, copy, modify, merge, publish, distribute, sublicense,
|
||||
and/or sell copies of the Software, and to permit persons to whom the
|
||||
Software is furnished to do so, subject to the following conditions:
|
||||
|
||||
The above copyright notice and this permission notice shall be included in
|
||||
all copies or substantial portions of the Software.
|
||||
|
||||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
|
||||
FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
|
||||
DEALINGS IN THE SOFTWARE.
|
|
@ -1,4 +0,0 @@
|
|||
# SPDX-License-Identifier: GPL-2.0-or-later OR GFDL-1.2-no-invariants-or-later
|
||||
|
||||
The texinfo version of the license gfdl-1.2 is distributed in the
|
||||
file doc/fdl.texi .
|
|
@ -1,690 +0,0 @@
|
|||
Valid-License-Identifier: GPL-3.0
|
||||
Valid-License-Identifier: GPL-3.0-only
|
||||
Valid-License-Identifier: GPL-3.0-or-later
|
||||
SPDX-URL: https://spdx.org/licenses/GPL-3.0.html
|
||||
Usage-Guide:
|
||||
To use this license in source code, put one of the following SPDX
|
||||
tag/value pairs into a comment according to the placement
|
||||
guidelines in the licensing rules documentation.
|
||||
For 'GNU General Public License (GPL) version 3 only' use:
|
||||
SPDX-License-Identifier: GPL-3.0
|
||||
or
|
||||
SPDX-License-Identifier: GPL-3.0-only
|
||||
For 'GNU General Public License (GPL) version 3 or any later version' use:
|
||||
SPDX-License-Identifier: GPL-3.0-or-later
|
||||
License-Text:
|
||||
|
||||
GNU GENERAL PUBLIC LICENSE
|
||||
Version 3, 29 June 2007
|
||||
|
||||
Copyright (C) 2007 Free Software Foundation, Inc. <https://fsf.org/>
|
||||
Everyone is permitted to copy and distribute verbatim copies
|
||||
of this license document, but changing it is not allowed.
|
||||
|
||||
Preamble
|
||||
|
||||
The GNU General Public License is a free, copyleft license for
|
||||
software and other kinds of works.
|
||||
|
||||
The licenses for most software and other practical works are designed
|
||||
to take away your freedom to share and change the works. By contrast,
|
||||
the GNU General Public License is intended to guarantee your freedom to
|
||||
share and change all versions of a program--to make sure it remains free
|
||||
software for all its users. We, the Free Software Foundation, use the
|
||||
GNU General Public License for most of our software; it applies also to
|
||||
any other work released this way by its authors. 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
|
||||
them 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 prevent others from denying you
|
||||
these rights or asking you to surrender the rights. Therefore, you have
|
||||
certain responsibilities if you distribute copies of the software, or if
|
||||
you modify it: responsibilities to respect the freedom of others.
|
||||
|
||||
For example, if you distribute copies of such a program, whether
|
||||
gratis or for a fee, you must pass on to the recipients the same
|
||||
freedoms that you received. 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.
|
||||
|
||||
Developers that use the GNU GPL protect your rights with two steps:
|
||||
(1) assert copyright on the software, and (2) offer you this License
|
||||
giving you legal permission to copy, distribute and/or modify it.
|
||||
|
||||
For the developers' and authors' protection, the GPL clearly explains
|
||||
that there is no warranty for this free software. For both users' and
|
||||
authors' sake, the GPL requires that modified versions be marked as
|
||||
changed, so that their problems will not be attributed erroneously to
|
||||
authors of previous versions.
|
||||
|
||||
Some devices are designed to deny users access to install or run
|
||||
modified versions of the software inside them, although the manufacturer
|
||||
can do so. This is fundamentally incompatible with the aim of
|
||||
protecting users' freedom to change the software. The systematic
|
||||
pattern of such abuse occurs in the area of products for individuals to
|
||||
use, which is precisely where it is most unacceptable. Therefore, we
|
||||
have designed this version of the GPL to prohibit the practice for those
|
||||
products. If such problems arise substantially in other domains, we
|
||||
stand ready to extend this provision to those domains in future versions
|
||||
of the GPL, as needed to protect the freedom of users.
|
||||
|
||||
Finally, every program is threatened constantly by software patents.
|
||||
States should not allow patents to restrict development and use of
|
||||
software on general-purpose computers, but in those that do, we wish to
|
||||
avoid the special danger that patents applied to a free program could
|
||||
make it effectively proprietary. To prevent this, the GPL assures that
|
||||
patents cannot be used to render the program non-free.
|
||||
|
||||
The precise terms and conditions for copying, distribution and
|
||||
modification follow.
|
||||
|
||||
TERMS AND CONDITIONS
|
||||
|
||||
0. Definitions.
|
||||
|
||||
"This License" refers to version 3 of the GNU General Public License.
|
||||
|
||||
"Copyright" also means copyright-like laws that apply to other kinds of
|
||||
works, such as semiconductor masks.
|
||||
|
||||
"The Program" refers to any copyrightable work licensed under this
|
||||
License. Each licensee is addressed as "you". "Licensees" and
|
||||
"recipients" may be individuals or organizations.
|
||||
|
||||
To "modify" a work means to copy from or adapt all or part of the work
|
||||
in a fashion requiring copyright permission, other than the making of an
|
||||
exact copy. The resulting work is called a "modified version" of the
|
||||
earlier work or a work "based on" the earlier work.
|
||||
|
||||
A "covered work" means either the unmodified Program or a work based
|
||||
on the Program.
|
||||
|
||||
To "propagate" a work means to do anything with it that, without
|
||||
permission, would make you directly or secondarily liable for
|
||||
infringement under applicable copyright law, except executing it on a
|
||||
computer or modifying a private copy. Propagation includes copying,
|
||||
distribution (with or without modification), making available to the
|
||||
public, and in some countries other activities as well.
|
||||
|
||||
To "convey" a work means any kind of propagation that enables other
|
||||
parties to make or receive copies. Mere interaction with a user through
|
||||
a computer network, with no transfer of a copy, is not conveying.
|
||||
|
||||
An interactive user interface displays "Appropriate Legal Notices"
|
||||
to the extent that it includes a convenient and prominently visible
|
||||
feature that (1) displays an appropriate copyright notice, and (2)
|
||||
tells the user that there is no warranty for the work (except to the
|
||||
extent that warranties are provided), that licensees may convey the
|
||||
work under this License, and how to view a copy of this License. If
|
||||
the interface presents a list of user commands or options, such as a
|
||||
menu, a prominent item in the list meets this criterion.
|
||||
|
||||
1. Source Code.
|
||||
|
||||
The "source code" for a work means the preferred form of the work
|
||||
for making modifications to it. "Object code" means any non-source
|
||||
form of a work.
|
||||
|
||||
A "Standard Interface" means an interface that either is an official
|
||||
standard defined by a recognized standards body, or, in the case of
|
||||
interfaces specified for a particular programming language, one that
|
||||
is widely used among developers working in that language.
|
||||
|
||||
The "System Libraries" of an executable work include anything, other
|
||||
than the work as a whole, that (a) is included in the normal form of
|
||||
packaging a Major Component, but which is not part of that Major
|
||||
Component, and (b) serves only to enable use of the work with that
|
||||
Major Component, or to implement a Standard Interface for which an
|
||||
implementation is available to the public in source code form. A
|
||||
"Major Component", in this context, means a major essential component
|
||||
(kernel, window system, and so on) of the specific operating system
|
||||
(if any) on which the executable work runs, or a compiler used to
|
||||
produce the work, or an object code interpreter used to run it.
|
||||
|
||||
The "Corresponding Source" for a work in object code form means all
|
||||
the source code needed to generate, install, and (for an executable
|
||||
work) run the object code and to modify the work, including scripts to
|
||||
control those activities. However, it does not include the work's
|
||||
System Libraries, or general-purpose tools or generally available free
|
||||
programs which are used unmodified in performing those activities but
|
||||
which are not part of the work. For example, Corresponding Source
|
||||
includes interface definition files associated with source files for
|
||||
the work, and the source code for shared libraries and dynamically
|
||||
linked subprograms that the work is specifically designed to require,
|
||||
such as by intimate data communication or control flow between those
|
||||
subprograms and other parts of the work.
|
||||
|
||||
The Corresponding Source need not include anything that users
|
||||
can regenerate automatically from other parts of the Corresponding
|
||||
Source.
|
||||
|
||||
The Corresponding Source for a work in source code form is that
|
||||
same work.
|
||||
|
||||
2. Basic Permissions.
|
||||
|
||||
All rights granted under this License are granted for the term of
|
||||
copyright on the Program, and are irrevocable provided the stated
|
||||
conditions are met. This License explicitly affirms your unlimited
|
||||
permission to run the unmodified Program. The output from running a
|
||||
covered work is covered by this License only if the output, given its
|
||||
content, constitutes a covered work. This License acknowledges your
|
||||
rights of fair use or other equivalent, as provided by copyright law.
|
||||
|
||||
You may make, run and propagate covered works that you do not
|
||||
convey, without conditions so long as your license otherwise remains
|
||||
in force. You may convey covered works to others for the sole purpose
|
||||
of having them make modifications exclusively for you, or provide you
|
||||
with facilities for running those works, provided that you comply with
|
||||
the terms of this License in conveying all material for which you do
|
||||
not control copyright. Those thus making or running the covered works
|
||||
for you must do so exclusively on your behalf, under your direction
|
||||
and control, on terms that prohibit them from making any copies of
|
||||
your copyrighted material outside their relationship with you.
|
||||
|
||||
Conveying under any other circumstances is permitted solely under
|
||||
the conditions stated below. Sublicensing is not allowed; section 10
|
||||
makes it unnecessary.
|
||||
|
||||
3. Protecting Users' Legal Rights From Anti-Circumvention Law.
|
||||
|
||||
No covered work shall be deemed part of an effective technological
|
||||
measure under any applicable law fulfilling obligations under article
|
||||
11 of the WIPO copyright treaty adopted on 20 December 1996, or
|
||||
similar laws prohibiting or restricting circumvention of such
|
||||
measures.
|
||||
|
||||
When you convey a covered work, you waive any legal power to forbid
|
||||
circumvention of technological measures to the extent such circumvention
|
||||
is effected by exercising rights under this License with respect to
|
||||
the covered work, and you disclaim any intention to limit operation or
|
||||
modification of the work as a means of enforcing, against the work's
|
||||
users, your or third parties' legal rights to forbid circumvention of
|
||||
technological measures.
|
||||
|
||||
4. Conveying Verbatim Copies.
|
||||
|
||||
You may convey 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;
|
||||
keep intact all notices stating that this License and any
|
||||
non-permissive terms added in accord with section 7 apply to the code;
|
||||
keep intact all notices of the absence of any warranty; and give all
|
||||
recipients a copy of this License along with the Program.
|
||||
|
||||
You may charge any price or no price for each copy that you convey,
|
||||
and you may offer support or warranty protection for a fee.
|
||||
|
||||
5. Conveying Modified Source Versions.
|
||||
|
||||
You may convey a work based on the Program, or the modifications to
|
||||
produce it from the Program, in the form of source code under the
|
||||
terms of section 4, provided that you also meet all of these conditions:
|
||||
|
||||
a) The work must carry prominent notices stating that you modified
|
||||
it, and giving a relevant date.
|
||||
|
||||
b) The work must carry prominent notices stating that it is
|
||||
released under this License and any conditions added under section
|
||||
7. This requirement modifies the requirement in section 4 to
|
||||
"keep intact all notices".
|
||||
|
||||
c) You must license the entire work, as a whole, under this
|
||||
License to anyone who comes into possession of a copy. This
|
||||
License will therefore apply, along with any applicable section 7
|
||||
additional terms, to the whole of the work, and all its parts,
|
||||
regardless of how they are packaged. This License gives no
|
||||
permission to license the work in any other way, but it does not
|
||||
invalidate such permission if you have separately received it.
|
||||
|
||||
d) If the work has interactive user interfaces, each must display
|
||||
Appropriate Legal Notices; however, if the Program has interactive
|
||||
interfaces that do not display Appropriate Legal Notices, your
|
||||
work need not make them do so.
|
||||
|
||||
A compilation of a covered work with other separate and independent
|
||||
works, which are not by their nature extensions of the covered work,
|
||||
and which are not combined with it such as to form a larger program,
|
||||
in or on a volume of a storage or distribution medium, is called an
|
||||
"aggregate" if the compilation and its resulting copyright are not
|
||||
used to limit the access or legal rights of the compilation's users
|
||||
beyond what the individual works permit. Inclusion of a covered work
|
||||
in an aggregate does not cause this License to apply to the other
|
||||
parts of the aggregate.
|
||||
|
||||
6. Conveying Non-Source Forms.
|
||||
|
||||
You may convey a covered work in object code form under the terms
|
||||
of sections 4 and 5, provided that you also convey the
|
||||
machine-readable Corresponding Source under the terms of this License,
|
||||
in one of these ways:
|
||||
|
||||
a) Convey the object code in, or embodied in, a physical product
|
||||
(including a physical distribution medium), accompanied by the
|
||||
Corresponding Source fixed on a durable physical medium
|
||||
customarily used for software interchange.
|
||||
|
||||
b) Convey the object code in, or embodied in, a physical product
|
||||
(including a physical distribution medium), accompanied by a
|
||||
written offer, valid for at least three years and valid for as
|
||||
long as you offer spare parts or customer support for that product
|
||||
model, to give anyone who possesses the object code either (1) a
|
||||
copy of the Corresponding Source for all the software in the
|
||||
product that is covered by this License, on a durable physical
|
||||
medium customarily used for software interchange, for a price no
|
||||
more than your reasonable cost of physically performing this
|
||||
conveying of source, or (2) access to copy the
|
||||
Corresponding Source from a network server at no charge.
|
||||
|
||||
c) Convey individual copies of the object code with a copy of the
|
||||
written offer to provide the Corresponding Source. This
|
||||
alternative is allowed only occasionally and noncommercially, and
|
||||
only if you received the object code with such an offer, in accord
|
||||
with subsection 6b.
|
||||
|
||||
d) Convey the object code by offering access from a designated
|
||||
place (gratis or for a charge), and offer equivalent access to the
|
||||
Corresponding Source in the same way through the same place at no
|
||||
further charge. You need not require recipients to copy the
|
||||
Corresponding Source along with the object code. If the place to
|
||||
copy the object code is a network server, the Corresponding Source
|
||||
may be on a different server (operated by you or a third party)
|
||||
that supports equivalent copying facilities, provided you maintain
|
||||
clear directions next to the object code saying where to find the
|
||||
Corresponding Source. Regardless of what server hosts the
|
||||
Corresponding Source, you remain obligated to ensure that it is
|
||||
available for as long as needed to satisfy these requirements.
|
||||
|
||||
e) Convey the object code using peer-to-peer transmission, provided
|
||||
you inform other peers where the object code and Corresponding
|
||||
Source of the work are being offered to the general public at no
|
||||
charge under subsection 6d.
|
||||
|
||||
A separable portion of the object code, whose source code is excluded
|
||||
from the Corresponding Source as a System Library, need not be
|
||||
included in conveying the object code work.
|
||||
|
||||
A "User Product" is either (1) a "consumer product", which means any
|
||||
tangible personal property which is normally used for personal, family,
|
||||
or household purposes, or (2) anything designed or sold for incorporation
|
||||
into a dwelling. In determining whether a product is a consumer product,
|
||||
doubtful cases shall be resolved in favor of coverage. For a particular
|
||||
product received by a particular user, "normally used" refers to a
|
||||
typical or common use of that class of product, regardless of the status
|
||||
of the particular user or of the way in which the particular user
|
||||
actually uses, or expects or is expected to use, the product. A product
|
||||
is a consumer product regardless of whether the product has substantial
|
||||
commercial, industrial or non-consumer uses, unless such uses represent
|
||||
the only significant mode of use of the product.
|
||||
|
||||
"Installation Information" for a User Product means any methods,
|
||||
procedures, authorization keys, or other information required to install
|
||||
and execute modified versions of a covered work in that User Product from
|
||||
a modified version of its Corresponding Source. The information must
|
||||
suffice to ensure that the continued functioning of the modified object
|
||||
code is in no case prevented or interfered with solely because
|
||||
modification has been made.
|
||||
|
||||
If you convey an object code work under this section in, or with, or
|
||||
specifically for use in, a User Product, and the conveying occurs as
|
||||
part of a transaction in which the right of possession and use of the
|
||||
User Product is transferred to the recipient in perpetuity or for a
|
||||
fixed term (regardless of how the transaction is characterized), the
|
||||
Corresponding Source conveyed under this section must be accompanied
|
||||
by the Installation Information. But this requirement does not apply
|
||||
if neither you nor any third party retains the ability to install
|
||||
modified object code on the User Product (for example, the work has
|
||||
been installed in ROM).
|
||||
|
||||
The requirement to provide Installation Information does not include a
|
||||
requirement to continue to provide support service, warranty, or updates
|
||||
for a work that has been modified or installed by the recipient, or for
|
||||
the User Product in which it has been modified or installed. Access to a
|
||||
network may be denied when the modification itself materially and
|
||||
adversely affects the operation of the network or violates the rules and
|
||||
protocols for communication across the network.
|
||||
|
||||
Corresponding Source conveyed, and Installation Information provided,
|
||||
in accord with this section must be in a format that is publicly
|
||||
documented (and with an implementation available to the public in
|
||||
source code form), and must require no special password or key for
|
||||
unpacking, reading or copying.
|
||||
|
||||
7. Additional Terms.
|
||||
|
||||
"Additional permissions" are terms that supplement the terms of this
|
||||
License by making exceptions from one or more of its conditions.
|
||||
Additional permissions that are applicable to the entire Program shall
|
||||
be treated as though they were included in this License, to the extent
|
||||
that they are valid under applicable law. If additional permissions
|
||||
apply only to part of the Program, that part may be used separately
|
||||
under those permissions, but the entire Program remains governed by
|
||||
this License without regard to the additional permissions.
|
||||
|
||||
When you convey a copy of a covered work, you may at your option
|
||||
remove any additional permissions from that copy, or from any part of
|
||||
it. (Additional permissions may be written to require their own
|
||||
removal in certain cases when you modify the work.) You may place
|
||||
additional permissions on material, added by you to a covered work,
|
||||
for which you have or can give appropriate copyright permission.
|
||||
|
||||
Notwithstanding any other provision of this License, for material you
|
||||
add to a covered work, you may (if authorized by the copyright holders of
|
||||
that material) supplement the terms of this License with terms:
|
||||
|
||||
a) Disclaiming warranty or limiting liability differently from the
|
||||
terms of sections 15 and 16 of this License; or
|
||||
|
||||
b) Requiring preservation of specified reasonable legal notices or
|
||||
author attributions in that material or in the Appropriate Legal
|
||||
Notices displayed by works containing it; or
|
||||
|
||||
c) Prohibiting misrepresentation of the origin of that material, or
|
||||
requiring that modified versions of such material be marked in
|
||||
reasonable ways as different from the original version; or
|
||||
|
||||
d) Limiting the use for publicity purposes of names of licensors or
|
||||
authors of the material; or
|
||||
|
||||
e) Declining to grant rights under trademark law for use of some
|
||||
trade names, trademarks, or service marks; or
|
||||
|
||||
f) Requiring indemnification of licensors and authors of that
|
||||
material by anyone who conveys the material (or modified versions of
|
||||
it) with contractual assumptions of liability to the recipient, for
|
||||
any liability that these contractual assumptions directly impose on
|
||||
those licensors and authors.
|
||||
|
||||
All other non-permissive additional terms are considered "further
|
||||
restrictions" within the meaning of section 10. If the Program as you
|
||||
received it, or any part of it, contains a notice stating that it is
|
||||
governed by this License along with a term that is a further
|
||||
restriction, you may remove that term. If a license document contains
|
||||
a further restriction but permits relicensing or conveying under this
|
||||
License, you may add to a covered work material governed by the terms
|
||||
of that license document, provided that the further restriction does
|
||||
not survive such relicensing or conveying.
|
||||
|
||||
If you add terms to a covered work in accord with this section, you
|
||||
must place, in the relevant source files, a statement of the
|
||||
additional terms that apply to those files, or a notice indicating
|
||||
where to find the applicable terms.
|
||||
|
||||
Additional terms, permissive or non-permissive, may be stated in the
|
||||
form of a separately written license, or stated as exceptions;
|
||||
the above requirements apply either way.
|
||||
|
||||
8. Termination.
|
||||
|
||||
You may not propagate or modify a covered work except as expressly
|
||||
provided under this License. Any attempt otherwise to propagate or
|
||||
modify it is void, and will automatically terminate your rights under
|
||||
this License (including any patent licenses granted under the third
|
||||
paragraph of section 11).
|
||||
|
||||
However, if you cease all violation of this License, then your
|
||||
license from a particular copyright holder is reinstated (a)
|
||||
provisionally, unless and until the copyright holder explicitly and
|
||||
finally terminates your license, and (b) permanently, if the copyright
|
||||
holder fails to notify you of the violation by some reasonable means
|
||||
prior to 60 days after the cessation.
|
||||
|
||||
Moreover, your license from a particular copyright holder is
|
||||
reinstated permanently if the copyright holder notifies you of the
|
||||
violation by some reasonable means, this is the first time you have
|
||||
received notice of violation of this License (for any work) from that
|
||||
copyright holder, and you cure the violation prior to 30 days after
|
||||
your receipt of the notice.
|
||||
|
||||
Termination of your rights under this section does not terminate the
|
||||
licenses of parties who have received copies or rights from you under
|
||||
this License. If your rights have been terminated and not permanently
|
||||
reinstated, you do not qualify to receive new licenses for the same
|
||||
material under section 10.
|
||||
|
||||
9. Acceptance Not Required for Having Copies.
|
||||
|
||||
You are not required to accept this License in order to receive or
|
||||
run a copy of the Program. Ancillary propagation of a covered work
|
||||
occurring solely as a consequence of using peer-to-peer transmission
|
||||
to receive a copy likewise does not require acceptance. However,
|
||||
nothing other than this License grants you permission to propagate or
|
||||
modify any covered work. These actions infringe copyright if you do
|
||||
not accept this License. Therefore, by modifying or propagating a
|
||||
covered work, you indicate your acceptance of this License to do so.
|
||||
|
||||
10. Automatic Licensing of Downstream Recipients.
|
||||
|
||||
Each time you convey a covered work, the recipient automatically
|
||||
receives a license from the original licensors, to run, modify and
|
||||
propagate that work, subject to this License. You are not responsible
|
||||
for enforcing compliance by third parties with this License.
|
||||
|
||||
An "entity transaction" is a transaction transferring control of an
|
||||
organization, or substantially all assets of one, or subdividing an
|
||||
organization, or merging organizations. If propagation of a covered
|
||||
work results from an entity transaction, each party to that
|
||||
transaction who receives a copy of the work also receives whatever
|
||||
licenses to the work the party's predecessor in interest had or could
|
||||
give under the previous paragraph, plus a right to possession of the
|
||||
Corresponding Source of the work from the predecessor in interest, if
|
||||
the predecessor has it or can get it with reasonable efforts.
|
||||
|
||||
You may not impose any further restrictions on the exercise of the
|
||||
rights granted or affirmed under this License. For example, you may
|
||||
not impose a license fee, royalty, or other charge for exercise of
|
||||
rights granted under this License, and you may not initiate litigation
|
||||
(including a cross-claim or counterclaim in a lawsuit) alleging that
|
||||
any patent claim is infringed by making, using, selling, offering for
|
||||
sale, or importing the Program or any portion of it.
|
||||
|
||||
11. Patents.
|
||||
|
||||
A "contributor" is a copyright holder who authorizes use under this
|
||||
License of the Program or a work on which the Program is based. The
|
||||
work thus licensed is called the contributor's "contributor version".
|
||||
|
||||
A contributor's "essential patent claims" are all patent claims
|
||||
owned or controlled by the contributor, whether already acquired or
|
||||
hereafter acquired, that would be infringed by some manner, permitted
|
||||
by this License, of making, using, or selling its contributor version,
|
||||
but do not include claims that would be infringed only as a
|
||||
consequence of further modification of the contributor version. For
|
||||
purposes of this definition, "control" includes the right to grant
|
||||
patent sublicenses in a manner consistent with the requirements of
|
||||
this License.
|
||||
|
||||
Each contributor grants you a non-exclusive, worldwide, royalty-free
|
||||
patent license under the contributor's essential patent claims, to
|
||||
make, use, sell, offer for sale, import and otherwise run, modify and
|
||||
propagate the contents of its contributor version.
|
||||
|
||||
In the following three paragraphs, a "patent license" is any express
|
||||
agreement or commitment, however denominated, not to enforce a patent
|
||||
(such as an express permission to practice a patent or covenant not to
|
||||
sue for patent infringement). To "grant" such a patent license to a
|
||||
party means to make such an agreement or commitment not to enforce a
|
||||
patent against the party.
|
||||
|
||||
If you convey a covered work, knowingly relying on a patent license,
|
||||
and the Corresponding Source of the work is not available for anyone
|
||||
to copy, free of charge and under the terms of this License, through a
|
||||
publicly available network server or other readily accessible means,
|
||||
then you must either (1) cause the Corresponding Source to be so
|
||||
available, or (2) arrange to deprive yourself of the benefit of the
|
||||
patent license for this particular work, or (3) arrange, in a manner
|
||||
consistent with the requirements of this License, to extend the patent
|
||||
license to downstream recipients. "Knowingly relying" means you have
|
||||
actual knowledge that, but for the patent license, your conveying the
|
||||
covered work in a country, or your recipient's use of the covered work
|
||||
in a country, would infringe one or more identifiable patents in that
|
||||
country that you have reason to believe are valid.
|
||||
|
||||
If, pursuant to or in connection with a single transaction or
|
||||
arrangement, you convey, or propagate by procuring conveyance of, a
|
||||
covered work, and grant a patent license to some of the parties
|
||||
receiving the covered work authorizing them to use, propagate, modify
|
||||
or convey a specific copy of the covered work, then the patent license
|
||||
you grant is automatically extended to all recipients of the covered
|
||||
work and works based on it.
|
||||
|
||||
A patent license is "discriminatory" if it does not include within
|
||||
the scope of its coverage, prohibits the exercise of, or is
|
||||
conditioned on the non-exercise of one or more of the rights that are
|
||||
specifically granted under this License. You may not convey a covered
|
||||
work if you are a party to an arrangement with a third party that is
|
||||
in the business of distributing software, under which you make payment
|
||||
to the third party based on the extent of your activity of conveying
|
||||
the work, and under which the third party grants, to any of the
|
||||
parties who would receive the covered work from you, a discriminatory
|
||||
patent license (a) in connection with copies of the covered work
|
||||
conveyed by you (or copies made from those copies), or (b) primarily
|
||||
for and in connection with specific products or compilations that
|
||||
contain the covered work, unless you entered into that arrangement,
|
||||
or that patent license was granted, prior to 28 March 2007.
|
||||
|
||||
Nothing in this License shall be construed as excluding or limiting
|
||||
any implied license or other defenses to infringement that may
|
||||
otherwise be available to you under applicable patent law.
|
||||
|
||||
12. No Surrender of Others' Freedom.
|
||||
|
||||
If 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 convey a
|
||||
covered work so as to satisfy simultaneously your obligations under this
|
||||
License and any other pertinent obligations, then as a consequence you may
|
||||
not convey it at all. For example, if you agree to terms that obligate you
|
||||
to collect a royalty for further conveying from those to whom you convey
|
||||
the Program, the only way you could satisfy both those terms and this
|
||||
License would be to refrain entirely from conveying the Program.
|
||||
|
||||
13. Use with the GNU Affero General Public License.
|
||||
|
||||
Notwithstanding any other provision of this License, you have
|
||||
permission to link or combine any covered work with a work licensed
|
||||
under version 3 of the GNU Affero General Public License into a single
|
||||
combined work, and to convey the resulting work. The terms of this
|
||||
License will continue to apply to the part which is the covered work,
|
||||
but the special requirements of the GNU Affero General Public License,
|
||||
section 13, concerning interaction through a network will apply to the
|
||||
combination as such.
|
||||
|
||||
14. Revised Versions of this License.
|
||||
|
||||
The Free Software Foundation may publish revised and/or new versions of
|
||||
the GNU 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 that a certain numbered version of the GNU General
|
||||
Public License "or any later version" applies to it, you have the
|
||||
option of following the terms and conditions either of that numbered
|
||||
version or of any later version published by the Free Software
|
||||
Foundation. If the Program does not specify a version number of the
|
||||
GNU General Public License, you may choose any version ever published
|
||||
by the Free Software Foundation.
|
||||
|
||||
If the Program specifies that a proxy can decide which future
|
||||
versions of the GNU General Public License can be used, that proxy's
|
||||
public statement of acceptance of a version permanently authorizes you
|
||||
to choose that version for the Program.
|
||||
|
||||
Later license versions may give you additional or different
|
||||
permissions. However, no additional obligations are imposed on any
|
||||
author or copyright holder as a result of your choosing to follow a
|
||||
later version.
|
||||
|
||||
15. Disclaimer of Warranty.
|
||||
|
||||
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.
|
||||
|
||||
16. Limitation of Liability.
|
||||
|
||||
IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING
|
||||
WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MODIFIES AND/OR CONVEYS
|
||||
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.
|
||||
|
||||
17. Interpretation of Sections 15 and 16.
|
||||
|
||||
If the disclaimer of warranty and limitation of liability provided
|
||||
above cannot be given local legal effect according to their terms,
|
||||
reviewing courts shall apply local law that most closely approximates
|
||||
an absolute waiver of all civil liability in connection with the
|
||||
Program, unless a warranty or assumption of liability accompanies a
|
||||
copy of the Program in return for a fee.
|
||||
|
||||
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
|
||||
state 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 3 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, see <https://www.gnu.org/licenses/>.
|
||||
|
||||
Also add information on how to contact you by electronic and paper mail.
|
||||
|
||||
If the program does terminal interaction, make it output a short
|
||||
notice like this when it starts in an interactive mode:
|
||||
|
||||
<program> Copyright (C) <year> <name of author>
|
||||
This program 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, your program's commands
|
||||
might be different; for a GUI interface, you would use an "about box".
|
||||
|
||||
You should also get your employer (if you work as a programmer) or school,
|
||||
if any, to sign a "copyright disclaimer" for the program, if necessary.
|
||||
For more information on this, and how to apply and follow the GNU GPL, see
|
||||
<https://www.gnu.org/licenses/>.
|
||||
|
||||
The GNU General Public License does not permit incorporating your program
|
||||
into proprietary programs. If your program is a subroutine library, you
|
||||
may consider it more useful to permit linking proprietary applications with
|
||||
the library. If this is what you want to do, use the GNU Lesser General
|
||||
Public License instead of this License. But first, please read
|
||||
<https://www.gnu.org/licenses/why-not-lgpl.html>.
|
94
Makefile.am
94
Makefile.am
|
@ -1,74 +1,33 @@
|
|||
# SPDX-License-Identifier: GPL-2.0-or-later
|
||||
|
||||
# not a GNU package. You can remove this line, if
|
||||
# have all needed files, that a GNU package needs
|
||||
AUTOMAKE_OPTIONS = gnu 1.6
|
||||
|
||||
.DELETE_ON_ERROR:
|
||||
|
||||
# make sure we pass the correct jimtcl flags to distcheck
|
||||
DISTCHECK_CONFIGURE_FLAGS = --disable-install-jim
|
||||
|
||||
# do not run Jim Tcl tests (esp. during distcheck)
|
||||
check-recursive: SUBDIRS :=
|
||||
|
||||
nobase_dist_pkgdata_DATA = \
|
||||
contrib/libdcc/dcc_stdio.c \
|
||||
contrib/libdcc/dcc_stdio.h \
|
||||
contrib/libdcc/example.c \
|
||||
contrib/libdcc/README \
|
||||
contrib/60-openocd.rules
|
||||
contrib/openocd.udev
|
||||
|
||||
if INTERNAL_JIMTCL
|
||||
SUBDIRS = jimtcl
|
||||
else
|
||||
SUBDIRS =
|
||||
DIST_SUBDIRS =
|
||||
bin_PROGRAMS =
|
||||
noinst_LTLIBRARIES =
|
||||
info_TEXINFOS =
|
||||
dist_man_MANS =
|
||||
EXTRA_DIST =
|
||||
|
||||
if INTERNAL_JIMTCL
|
||||
SUBDIRS += jimtcl
|
||||
DIST_SUBDIRS += jimtcl
|
||||
endif
|
||||
|
||||
# common flags used in openocd build
|
||||
AM_CFLAGS = $(GCC_WARNINGS)
|
||||
SUBDIRS += src doc
|
||||
|
||||
AM_CPPFLAGS = $(HOST_CPPFLAGS)\
|
||||
-I$(top_srcdir)/src \
|
||||
-I$(top_builddir)/src \
|
||||
-DPKGDATADIR=\"$(pkgdatadir)\" \
|
||||
-DBINDIR=\"$(bindir)\"
|
||||
|
||||
if INTERNAL_JIMTCL
|
||||
AM_CPPFLAGS += -I$(top_srcdir)/jimtcl \
|
||||
-I$(top_builddir)/jimtcl
|
||||
endif
|
||||
EXTRA_DIST += \
|
||||
EXTRA_DIST = \
|
||||
BUGS \
|
||||
HACKING \
|
||||
NEWTAPS \
|
||||
README.Windows \
|
||||
README.macOS \
|
||||
$(EXTRA_DIST_NEWS) \
|
||||
README.Win32 \
|
||||
Doxyfile.in \
|
||||
LICENSES/license-rules.txt \
|
||||
LICENSES/exceptions/eCos-exception-2.0 \
|
||||
LICENSES/preferred/BSD-1-Clause \
|
||||
LICENSES/preferred/BSD-2-Clause \
|
||||
LICENSES/preferred/BSD-2-Clause-Views \
|
||||
LICENSES/preferred/BSD-3-Clause \
|
||||
LICENSES/preferred/BSD-Source-Code \
|
||||
LICENSES/preferred/GFDL-1.2 \
|
||||
LICENSES/preferred/gfdl-1.2.texi.readme \
|
||||
LICENSES/preferred/GPL-2.0 \
|
||||
LICENSES/preferred/MIT \
|
||||
LICENSES/stand-alone/GPL-3.0 \
|
||||
tools/logger.pl \
|
||||
tools/rlink_make_speed_table \
|
||||
tools/st7_dtc_as \
|
||||
contrib
|
||||
contrib/loaders
|
||||
|
||||
libtool: $(LIBTOOL_DEPS)
|
||||
$(SHELL) ./config.status --recheck
|
||||
|
@ -130,29 +89,20 @@ uninstall-hook:
|
|||
distclean-local:
|
||||
rm -rf Doxyfile doxygen
|
||||
rm -f $(srcdir)/jimtcl/configure.gnu
|
||||
|
||||
|
||||
DISTCLEANFILES = doxygen.log
|
||||
|
||||
METASOURCES = AUTO
|
||||
|
||||
BUILT_SOURCES =
|
||||
CLEANFILES =
|
||||
|
||||
MAINTAINERCLEANFILES = \
|
||||
%D%/INSTALL \
|
||||
%D%/configure \
|
||||
%D%/Makefile.in \
|
||||
%D%/depcomp \
|
||||
%D%/config.guess \
|
||||
%D%/config.sub \
|
||||
%D%/config.h.in \
|
||||
%D%/config.h.in~ \
|
||||
%D%/compile \
|
||||
%D%/ltmain.sh \
|
||||
%D%/missing \
|
||||
%D%/aclocal.m4 \
|
||||
%D%/install-sh \
|
||||
%D%/texinfo.tex
|
||||
|
||||
include src/Makefile.am
|
||||
include doc/Makefile.am
|
||||
$(srcdir)/INSTALL \
|
||||
$(srcdir)/configure \
|
||||
$(srcdir)/Makefile.in \
|
||||
$(srcdir)/depcomp \
|
||||
$(srcdir)/config.guess \
|
||||
$(srcdir)/config.sub \
|
||||
$(srcdir)/config.h.in \
|
||||
$(srcdir)/config.h.in~ \
|
||||
$(srcdir)/compile \
|
||||
$(srcdir)/ltmain.sh \
|
||||
$(srcdir)/missing \
|
||||
$(srcdir)/aclocal.m4 \
|
||||
$(srcdir)/install-sh
|
||||
|
|
45
NEWS
45
NEWS
|
@ -1,31 +1,50 @@
|
|||
This file includes highlights of the changes made in the OpenOCD
|
||||
source archive release.
|
||||
This file includes highlights of the changes made in the
|
||||
OpenOCD source archive release. See the
|
||||
repository history for details about what changed, including
|
||||
bugfixes and other issues not mentioned here.
|
||||
|
||||
JTAG Layer:
|
||||
New STLINK V1/V2 JTAG/SWD adapter support.
|
||||
New OSJTAG adapter support.
|
||||
New Tincantools Flyswatter2 support.
|
||||
Improved ULINK driver.
|
||||
Improved RLINK driver.
|
||||
Support for adapters based on FT232H chips.
|
||||
New experimental driver for FTDI based adapters, using libusb-1.0 in asynchronous mode.
|
||||
|
||||
Boundary Scan:
|
||||
|
||||
Target Layer:
|
||||
New Cortex-M0 support.
|
||||
New Cortex-M4 support.
|
||||
Improved Working area algorithm.
|
||||
New RTOS support. Currently linux, FreeRTOS, ThreadX and eCos.
|
||||
Connecting under reset to Cortex-Mx and MIPS chips.
|
||||
|
||||
Flash Layer:
|
||||
New SST39WF1601 support.
|
||||
New EN29LV800BB support.
|
||||
New async algorithm support for selected targets, stm32, stellaris and pic32.
|
||||
New Atmel SAM3S, SAM3N support.
|
||||
New ST STM32L support.
|
||||
New Microchip PIC32MX1xx/2xx support.
|
||||
New Freescale Kinetis K40 support.
|
||||
|
||||
Board, Target, and Interface Configuration Scripts:
|
||||
|
||||
Server Layer:
|
||||
|
||||
RTOS:
|
||||
Support Dangerous Prototypes Bus Blaster.
|
||||
Support ST SPEAr Family.
|
||||
Support Gumstix Verdex boards.
|
||||
Support TI Beaglebone.
|
||||
|
||||
Documentation:
|
||||
Improved HACKING info for submitting patches.
|
||||
Fixed numerous broken links.
|
||||
|
||||
Build and Release:
|
||||
|
||||
|
||||
This release also contains a number of other important functional and
|
||||
cosmetic bugfixes. For more details about what has changed since the
|
||||
last release, see the git repository history:
|
||||
|
||||
http://sourceforge.net/p/openocd/code/ci/v0.x.0/log/?path=
|
||||
|
||||
For more details about what has changed since the last release,
|
||||
see the git repository history. With gitweb, you can browse that
|
||||
in various levels of detail.
|
||||
|
||||
For older NEWS, see the NEWS files associated with each release
|
||||
(i.e. NEWS-<version>).
|
||||
|
|
155
NEWS-0.10.0
155
NEWS-0.10.0
|
@ -1,155 +0,0 @@
|
|||
This file includes highlights of the changes made in the OpenOCD
|
||||
source archive release.
|
||||
|
||||
JTAG Layer:
|
||||
* New driver for J-Link adapters based on libjaylink
|
||||
(including support for FPGA configuration, SWO and EMUCOM)
|
||||
* FTDI improvements to work at 30MHz clock
|
||||
* BCM2835 native driver SWD and Raspberry Pi2 support
|
||||
* BCM2835 is set to 4ma drive, slow slew rate
|
||||
* ixo-usb-jtag (emulation of an Altera Bus Blaster I on
|
||||
Cypress FX2 IC) support
|
||||
* JTAG pass-through mode for CMSIS-DAP (including support for
|
||||
FPGA configuration)
|
||||
* OpenJTAG support for Cypress CY7C65215
|
||||
* connect_assert_srst support for SWD
|
||||
* Xilinx Virtex-II Series7 bitstream loading support
|
||||
* Use JEP106 data to decode IDs
|
||||
* Deprecated "ft2232" driver removed (use "ftdi" instead)
|
||||
* GPL-incompatible FTDI D2XX library support dropped (Presto,
|
||||
OpenJTAG and USB-Blaster I are using libftdi only now)
|
||||
* ZY1000 support dropped (unmaintained since long)
|
||||
* oocd_trace support dropped
|
||||
|
||||
Boundary Scan:
|
||||
|
||||
Target Layer:
|
||||
* ARMv7-A, Cortex-M, Cortex-A/R important fixes and
|
||||
improvements (allowing e.g. simultaneous debugging of A8 and
|
||||
M3 cores, JTAG WAIT support etc.)
|
||||
* ARM Cortex-A,R allow interrupt disable during single-step
|
||||
(maskisr command)
|
||||
* Semihosting support for ARMv7-A
|
||||
* ARM Cortex-M7 support
|
||||
* Intel Quark mcu D2000 support
|
||||
* Freescale LS102x SAP support
|
||||
* ThreadX RTOS support on ARM926E-JS
|
||||
* Cortex-M RTOS stack alignment fixes
|
||||
* FreeRTOS FPU support
|
||||
* uC/OS-III RTOS support
|
||||
* bridging semihosting to GDB's File-I/O support
|
||||
* -defer-examine option added to target create command
|
||||
* verify_image_checksum command added
|
||||
|
||||
Flash Layer:
|
||||
* Atmel SAM4S, SAM4N, SAM4C support
|
||||
* Atmel SAMV, SAMS, SAME (Cortex-M7) support
|
||||
* Atmel AT91SAMD handle reset run/halt in DSU, other fixes
|
||||
* Atmel AT91SAML21, SAML22, SAMC20/SAMC21, SAMD09 support
|
||||
* ST STM32F4x support
|
||||
* ST STM32F74x/76x/77x, STM32L4 support
|
||||
* ST STM32L0 categories 1, 2 and 5 support
|
||||
* Kinetis K02, K21, K22, K24, K26, K63, K64, K66 support
|
||||
* Kinetis KE, KVx, K8x families support
|
||||
* Kinetis FlexNVM handling
|
||||
* Kinetis flash protection, security, mass_erase improvements
|
||||
* Infineon XMC4xxx family support
|
||||
* Infineon XMC1000 flash driver
|
||||
* Energy Micro EFM32 Happy Gecko support
|
||||
* Energy Micro EFM32 debug interface lock support
|
||||
* Analog Devices ADuCM360 support
|
||||
* Unified Nuvoton NuMicro flash driver
|
||||
* NIIET K1921VK01T (Cortex-M4) support
|
||||
* Nordic Semiconductor nRF51 improvements
|
||||
* Spansion FM4 flash (including MB9BFx64/x65, S6E2DH) driver
|
||||
* Ambiq Micro Apollo flash driver
|
||||
* PIC32MX new device IDs, 17x/27x flash support
|
||||
* read_bank() and verify_bank() NOR flash internal API to
|
||||
allow reading (and verifying) non-memory-mapped devices
|
||||
* JTAGSPI driver to access SPI NOR flashes via a trivial
|
||||
FPGA proxy
|
||||
* Milandr read/verify for Info memory support
|
||||
* Various discrete SPI NOR flashes support
|
||||
* CFI 16-bit flash reversed endianness support
|
||||
|
||||
Board, Target, and Interface Configuration Scripts:
|
||||
* Digilent JTAG-HS2, JTAG-HS3 interfaces configs
|
||||
* FTDI UM232H module as JTAG interface config
|
||||
* 100ask's OpenJTAG interface config
|
||||
* MBFTDI interface config
|
||||
* XDS100v3 interface config
|
||||
* Freescale Vybrid VF6xx target config
|
||||
* EmCraft VF6 SOM and baseboard configs
|
||||
* Freescale SabreSD board config
|
||||
* Freescale VF65GS10 tower board config
|
||||
* Pipistrello Xilinx Spartan6 LX45 FPGA board config
|
||||
* miniSpartan6+ board config
|
||||
* Xilinx Kintex7 Development board config
|
||||
* Parallella-I board config
|
||||
* Digilent Atlys and Analog Discovery board configs
|
||||
* Numato Opsis board config
|
||||
* Xilinx Spartan 6 FPGA "Device DNA" reading support
|
||||
* Altera 10M50 FPGA (MAX10 family) target config
|
||||
* Altera EPM240 CPLD (MAXII family) target config
|
||||
* Marsohod2, Marsohod3 FPGA, Marsohod CPLD boards configs
|
||||
* Novena's integrated FPGA board config
|
||||
* XMOS XS1-XAU8A-10's ARM core config
|
||||
* XMOS xCORE-XA Core Module board config
|
||||
* Exynos5250 target config
|
||||
* Arndale board config
|
||||
* FM4 MB9BFxxx family configs
|
||||
* Spansion SK-FM4-U120-9B560 board config
|
||||
* Diolan LPC4357-DB1 board config
|
||||
* ST STM32F469 discovery board config
|
||||
* ST STM32F7-DISCO, STM327[4|5]6G-EVAL boards configs
|
||||
* ST STM32L4 discovery, NUCLEO L476RG, STM32F429I-DISC1 boards
|
||||
configs
|
||||
* Atheros AR2313, AR2315 targets config
|
||||
* Netgear WP102 board config
|
||||
* La Fonera FON2200 board config
|
||||
* Linksys WAG200G board config
|
||||
* LPC-Link2 board config
|
||||
* NXP LPC4370 target config
|
||||
* Atmel SAMV, SAMS, SAME target configs
|
||||
* Atmel SAM E70 Xplained, SAM V71 Xplained Ultra boards
|
||||
configs
|
||||
* Nordic nRF52 target config
|
||||
* Nordic nRF51-DK, nRF52-DK boards configs
|
||||
* Infineon XMC4700 Relax Kit, XMC4800 Relax EtherCAT Kit,
|
||||
XMC4300 Relax EtherCAT Kit boards configs
|
||||
* Renesas S7G2 target config
|
||||
* Renesas DK-S7G2 board config
|
||||
* Altera EP3C10 FPGA (Cyclone III family) target config
|
||||
* TI MSP432P4xx target config
|
||||
* Cypress PSoC 5LP target config
|
||||
* Analog Devices ADSP-SC58x target config (Cortex-A5 core only)
|
||||
|
||||
Server Layer:
|
||||
* tcl_trace command for async target trace output via Tcl RPC
|
||||
|
||||
Documentation:
|
||||
|
||||
Build and Release:
|
||||
* Various fixes thanks to http://coccinellery.org/
|
||||
* libftdi is now autodetected with pkgconfig
|
||||
* Releases should now support reproducible builds
|
||||
* Conversion to non-recursive make, requires automake >= 1.14
|
||||
* Udev rules modified to add uaccess tag and moved to
|
||||
60-openocd.rules
|
||||
* Support searching for scripts relative to the openocd binary
|
||||
for all major architectures
|
||||
|
||||
|
||||
This release also contains a number of other important functional and
|
||||
cosmetic bugfixes. For more details about what has changed since the
|
||||
last release, see the git repository history:
|
||||
|
||||
http://sourceforge.net/p/openocd/code/ci/v0.10.0/log/?path=
|
||||
|
||||
|
||||
For older NEWS, see the NEWS files associated with each release
|
||||
(i.e. NEWS-<version>).
|
||||
|
||||
For more information about contributing test reports, bug fixes, or new
|
||||
features and device support, please read the new Developer Manual (or
|
||||
the BUGS and PATCHES.txt files in the source archive).
|
238
NEWS-0.11.0
238
NEWS-0.11.0
|
@ -1,238 +0,0 @@
|
|||
This file includes highlights of the changes made in the OpenOCD
|
||||
source archive release.
|
||||
|
||||
JTAG Layer:
|
||||
* add debug level 4 for verbose I/O debug
|
||||
* bitbang, add read buffer to improve performance
|
||||
* Cadence SystemVerilog Direct Programming Interface (DPI) adapter driver
|
||||
* CMSIS-DAP v2 (USB bulk based) adapter driver
|
||||
* Cypress KitProg adapter driver
|
||||
* FTDI FT232R sync bitbang adapter driver
|
||||
* Linux GPIOD bitbang adapter driver through libgpiod
|
||||
* Mellanox rshim USB or PCIe adapter driver
|
||||
* Nuvoton Nu-Link and Nu-Link2 adapter drivers
|
||||
* NXP IMX GPIO mmap based adapter driver
|
||||
* ST-Link consolidate all versions in single config
|
||||
* ST-Link read properly old USB serial numbers
|
||||
* STLink/V3 support (for ST devices only !)
|
||||
* STM8 SWIM transport
|
||||
* TI XDS110 adapter driver
|
||||
* Xilinx XVC/PCIe adapter driver
|
||||
|
||||
Boundary Scan:
|
||||
|
||||
Target Layer:
|
||||
* 64 bit address support
|
||||
* ARCv2 target support
|
||||
* ARM Cortex-A hypervisor mode support
|
||||
* ARM Cortex-M fast PC sampling support for profiling
|
||||
* ARM generic CTI support
|
||||
* ARM generic mem-ap target support
|
||||
* ARMv7-A MMU tools
|
||||
* ARMv7m traces add TCP stream server
|
||||
* ARMv8 AARCH64 target support and semihosting support
|
||||
* ARMv8 AARCH64 disassembler support through capstone library
|
||||
* ARMv8-M target support
|
||||
* EnSilica eSi-RISC target support, including instruction tracing
|
||||
eSi-Trace support
|
||||
* MIPS64 target support
|
||||
* Motorola SREC S6 record image file support
|
||||
* RISC-V target support
|
||||
* SEGGER Real Time Transfer (RTT) initial support (for single target,
|
||||
Cortex-M only)
|
||||
* ST STM8 target support
|
||||
* Various MIPS32 target improvements
|
||||
|
||||
Flash Layer:
|
||||
* Atheros (ath79) SPI interface support
|
||||
* Atmel atmega128rfa1 support
|
||||
* Atmel SAM D21, D51, DA1, E51, E53, E54, G55, R30 support
|
||||
* Atmel SAMC2?N* support
|
||||
* Cypress PSoC5LP, PSoC6 support
|
||||
* EnSilica eSi-RISC support
|
||||
* Foshan Synwit Tech SWM050 support
|
||||
* Maxim Integrated MAX32XXX support
|
||||
* Nordic Semiconductor nRF51822, nRF52810, nRF52832 support
|
||||
* NXP Kinetis K27, K28, KE1x, KEAx, KL28, KL8x, KV5x, KWx support
|
||||
* Renesas RPC HF support
|
||||
* SH QSPI support
|
||||
* SiFive Freedom E support
|
||||
* Silicon Labs EFR-family, EZR32HG support
|
||||
* ST BlueNRG support
|
||||
* ST STM32 QUAD/OCTO-SPI interface support for Flash, FRAM and EEPROM
|
||||
* ST STM32F72x, STM32F4x3, STM32H7xx support
|
||||
* ST STM32G0xx, STM32G4xx, STM32L4x, STM32WB, STM32WL support
|
||||
* ST STM32L5x support (non secure mode)
|
||||
* TI CC13xx, CC26xx, CC32xx support
|
||||
* TI MSP432 support
|
||||
* Winner Micro w600 support
|
||||
* Xilinx XCF platform support
|
||||
* Various discrete SPI NOR flashes support
|
||||
|
||||
Board, Target, and Interface Configuration Scripts:
|
||||
* 8devices LIMA board config
|
||||
* Achilles Instant-Development Kit Arria 10 board config
|
||||
* Amazon Kindle 2 and DX board config
|
||||
* Analog Devices ADSP-SC58x, ADSP-SC584-EZBRD board config
|
||||
* Andes Technology ADP-XC7KFF676 board config
|
||||
* Andes Technology Corvette-F1 board config
|
||||
* ARM Musca A board config
|
||||
* Arty Spartan 7 FPGA board config
|
||||
* Atmel SAMD10 Xplained mini board config
|
||||
* Atmel SAMD11 Xplained Pro board config
|
||||
* Atmel SAM G55 Xplained Pro board config
|
||||
* AVNET UltraZED EG StarterKit board config
|
||||
* Blue Pill STM32F103C8 board config
|
||||
* DP Busblaster v4.1a board config
|
||||
* DPTechnics DPT-Board-v1 board config
|
||||
* Emcraft imx8 SOM BSB board config
|
||||
* Globalscale ESPRESSObin board config
|
||||
* Kasli board config
|
||||
* Kintex Ultrascale XCKU040 board config
|
||||
* Knovative KC-100 board config
|
||||
* LeMaker HiKey board config
|
||||
* Microchip (Atmel) SAME54 Xplained Pro board config
|
||||
* Microchip (Atmel) SAML11 Xplained Pro board config
|
||||
* Nordic module NRF52 board config
|
||||
* Numato Lab Mimas A7 board config
|
||||
* NXP Freedom FRDM-LS1012A board config
|
||||
* NXP IMX7SABRE board config
|
||||
* NXP IMX8MP-EVK board config
|
||||
* NXP MC-IMX8M-EVK board config
|
||||
* QuickLogic QuickFeather board config
|
||||
* Renesas R-Car E2, H2, M2 board config
|
||||
* Renesas R-Car Salvator-X(S) board config
|
||||
* Renesas RZ/A1H GR-Peach board config
|
||||
* Rigado BMD-300 board config
|
||||
* Sayma AMC board config
|
||||
* Sifive e31arty, e51arty, hifive1 board config
|
||||
* ST B-L475E-IOT01A board config
|
||||
* ST BlueNRG idb007v1, idb008v1, idb011v1 board config
|
||||
* ST STM32F412g discovery board config
|
||||
* ST STM32F413h discovery board config
|
||||
* ST STM32F469i discovery board config
|
||||
* ST STM32F7 Nucleo board config
|
||||
* ST STM32F723e discovery board config
|
||||
* ST STM32F746g discovery board config
|
||||
* ST STM32F769i discovery board config
|
||||
* ST STM32H735g discovery board config
|
||||
* ST STM32H743zi Nucleo board config
|
||||
* ST STM32H745i discovery board config
|
||||
* ST STM32H747i discovery board config
|
||||
* ST STM32H750b discovery board config
|
||||
* ST STM32H7b3i discovery board config
|
||||
* ST STM32H7x_dual_qspi board config
|
||||
* ST STM32H7x3i Eval boards config
|
||||
* ST STM32L073 Nucleo board config
|
||||
* ST STM32L476g discovery board config
|
||||
* ST STM32L496g discovery board config
|
||||
* ST STM32L4p5g discovery board config
|
||||
* ST STM32L4r9i discovery board config
|
||||
* ST STM32L5 Nucleo board config
|
||||
* ST STM32MP15x DK2 board config
|
||||
* ST STM32WB Nucleo board config
|
||||
* ST STM8L152R8 Nucleo board config
|
||||
* Synopsys DesignWare ARC EM board config
|
||||
* Synopsys DesignWare ARC HSDK board config
|
||||
* TI BeagleBone family boards config
|
||||
* TI CC13xx, CC26xx, CC32xx LaunchPad board config
|
||||
* TI MSP432 LaunchPad board config
|
||||
* Tocoding Poplar board config
|
||||
* TP-Link WDR4300 board config
|
||||
* Allwinner V3s target config
|
||||
* Andes Technology NDS V5 target config
|
||||
* Atmel atmega128rfa1 target config
|
||||
* ARM corelink SSE-200 target config
|
||||
* Atheros_ar9344 target config
|
||||
* Cypress PSoC5LP, PSoC6 target config
|
||||
* EnSilica eSi-RISC target config
|
||||
* Foshan Synwit Tech SWM050 target config
|
||||
* GigaDevice GD32VF103 target config
|
||||
* Hisilicon Hi3798 target config
|
||||
* Hisilicon Hi6220 target config
|
||||
* Infineon TLE987x target config
|
||||
* Marvell Armada 3700 target config
|
||||
* Maxim Integrated MAX32XXX target config
|
||||
* Mellanox BlueField target config
|
||||
* Microchip (Atmel) SAME5x, SAML1x target config
|
||||
* NXP IMX6SX, IMX6UL, IMX7, IMX7ULP, IMX8 target config
|
||||
* NXP Kinetis KE1xZ, KE1xF target config
|
||||
* NXP LPC84x, LPC8Nxx, LS1012A, NHS31xx target config
|
||||
* Qualcomm QCA4531 target config
|
||||
* QuickLogic EOS S3 target config
|
||||
* Renesas R-Car E2, H2, M2 target config
|
||||
* Renesas R-Car Gen3 target config
|
||||
* Renesas RZ/A1H target config
|
||||
* Rockchip RK3308 target config
|
||||
* ST BlueNRG target config
|
||||
* ST STM32G0, STM32G4, STM32H7, STM32L0, STM32L5 target config
|
||||
* ST STM32MP15x target config
|
||||
* ST STM32WBx, STM32WLEx target config
|
||||
* ST STM8L152, S003, S103, S105 target config
|
||||
* Synopsys DesignWare ARC EM target config
|
||||
* Synopsys DesignWare ARC HS Development Kit SoC target config
|
||||
* TI CC13xx, CC26xx, CC32xx target config
|
||||
* TI TNETC4401 target config
|
||||
* Xilinx UltraScale+ target config
|
||||
* Altera 5M570Z (MAXV family) CPLD config
|
||||
* Xilinx Ultrascale, XCF CPLD config
|
||||
* Intel (Altera) Arria10 FPGA config
|
||||
* Cadence SystemVerilog Direct Programming Interface (DPI) interface config
|
||||
* Cypress KitProg interface config
|
||||
* Digilent SMT2 NC interface config
|
||||
* DLN-2 example of Linux GPIOD interface config
|
||||
* FTDI C232HM interface config
|
||||
* HIE JTAG Debugger interface config
|
||||
* In-Circuit's ICprog interface config
|
||||
* isodebug isolated JTAG/SWD+UART interface config
|
||||
* Mellanox rshim USB or PCIe interface config
|
||||
* Nuvoton Nu-Link interface config
|
||||
* NXP IMX GPIO mmap based interface config
|
||||
* Steppenprobe open hardware interface config
|
||||
* TI XDS110 interface config
|
||||
|
||||
Server Layer:
|
||||
* 64 bit address support
|
||||
* default bind to IPv4 localhost
|
||||
* gdb: allow multiple connections
|
||||
* gdb: architecture element support
|
||||
* gdb: vCont, vRun support
|
||||
* telnet: handle Ctrl+A, Ctrl+E and Ctrl+K
|
||||
|
||||
RTOS:
|
||||
* Chromium-EC rtos support
|
||||
* hwthread pseudo rtos support
|
||||
* NuttX rtos support
|
||||
* RIOT rtos support
|
||||
|
||||
Documentation:
|
||||
* Improve STM32 flash driver
|
||||
* Various typo fix and improvements
|
||||
|
||||
Build and Release:
|
||||
* Add libutil to support jimtcl version 0.80
|
||||
* Clang warning fixes
|
||||
* GitHub workflow for Win32 snapshot binaries
|
||||
* Handle Tcl return values consistently
|
||||
* Mitigation for CVE-2018-5704: Prevent some forms of Cross
|
||||
Protocol Scripting attacks
|
||||
* Support for libftdi 1.5
|
||||
* Travis-CI basic support
|
||||
* Update libjaylink to version 0.2.0
|
||||
* Update jimtcl to version 0.79
|
||||
* Use external (optional) library capstone for ARM and AARCH64 disassembly
|
||||
|
||||
|
||||
This release also contains a number of other important functional and
|
||||
cosmetic bugfixes. For more details about what has changed since the
|
||||
last release, see the git repository history:
|
||||
|
||||
http://sourceforge.net/p/openocd/code/ci/v0.11.0/log/?path=
|
||||
|
||||
|
||||
For older NEWS, see the NEWS files associated with each release
|
||||
(i.e. NEWS-<version>).
|
||||
|
||||
For more information about contributing test reports, bug fixes, or new
|
||||
features and device support, please read the new Developer Manual (or
|
||||
the BUGS and PATCHES.txt files in the source archive).
|
|
@ -71,3 +71,4 @@ For older NEWS, see the NEWS files associated with each release
|
|||
For more information about contributing test reports, bug fixes, or new
|
||||
features and device support, please read the new Developer Manual (or
|
||||
the BUGS and PATCHES.txt files in the source archive).
|
||||
|
||||
|
|
54
NEWS-0.6.0
54
NEWS-0.6.0
|
@ -1,54 +0,0 @@
|
|||
This file includes highlights of the changes made in the
|
||||
OpenOCD source archive release. See the
|
||||
repository history for details about what changed, including
|
||||
bugfixes and other issues not mentioned here.
|
||||
|
||||
JTAG Layer:
|
||||
New STLINK V1/V2 JTAG/SWD adapter support.
|
||||
New OSJTAG adapter support.
|
||||
New Tincantools Flyswatter2 support.
|
||||
Improved ULINK driver.
|
||||
Improved RLINK driver.
|
||||
Support for adapters based on FT232H chips.
|
||||
New experimental driver for FTDI based adapters, using libusb-1.0 in asynchronous mode.
|
||||
|
||||
Boundary Scan:
|
||||
|
||||
Target Layer:
|
||||
New Cortex-M0 support.
|
||||
New Cortex-M4 support.
|
||||
Improved Working area algorithm.
|
||||
New RTOS support. Currently linux, FreeRTOS, ThreadX and eCos.
|
||||
Connecting under reset to Cortex-Mx and MIPS chips.
|
||||
|
||||
Flash Layer:
|
||||
New SST39WF1601 support.
|
||||
New EN29LV800BB support.
|
||||
New async algorithm support for selected targets, stm32, stellaris and pic32.
|
||||
New Atmel SAM3S, SAM3N support.
|
||||
New ST STM32L support.
|
||||
New Microchip PIC32MX1xx/2xx support.
|
||||
New Freescale Kinetis K40 support.
|
||||
|
||||
Board, Target, and Interface Configuration Scripts:
|
||||
Support Dangerous Prototypes Bus Blaster.
|
||||
Support ST SPEAr Family.
|
||||
Support Gumstix Verdex boards.
|
||||
Support TI Beaglebone.
|
||||
|
||||
Documentation:
|
||||
Improved HACKING info for submitting patches.
|
||||
Fixed numerous broken links.
|
||||
|
||||
Build and Release:
|
||||
|
||||
For more details about what has changed since the last release,
|
||||
see the git repository history. With gitweb, you can browse that
|
||||
in various levels of detail.
|
||||
|
||||
For older NEWS, see the NEWS files associated with each release
|
||||
(i.e. NEWS-<version>).
|
||||
|
||||
For more information about contributing test reports, bug fixes, or new
|
||||
features and device support, please read the new Developer Manual (or
|
||||
the BUGS and PATCHES.txt files in the source archive).
|
43
NEWS-0.7.0
43
NEWS-0.7.0
|
@ -1,43 +0,0 @@
|
|||
This file includes highlights of the changes made in the
|
||||
OpenOCD source archive release. See the
|
||||
repository history for details about what changed, including
|
||||
bugfixes and other issues not mentioned here.
|
||||
|
||||
JTAG Layer:
|
||||
New TI ICDI adapter support.
|
||||
Support Latest OSBDM firmware.
|
||||
Improved MIPS EJTAG Support.
|
||||
|
||||
Boundary Scan:
|
||||
|
||||
Target Layer:
|
||||
New ARMv7R and Cortex-R4 support.
|
||||
Added ChibiOS/RT support.
|
||||
|
||||
Flash Layer:
|
||||
New NXP LPC1850 support.
|
||||
New NXP LPC4300 support.
|
||||
New NXP SPIFI support.
|
||||
New Energy Micro EFM32 support.
|
||||
New ST STM32W support.
|
||||
New ST STM32f2 write protection and lock/unlock support.
|
||||
Ability to override STM32 flash bank size.
|
||||
|
||||
Board, Target, and Interface Configuration Scripts:
|
||||
Support Freescale i.MX6 series targets.
|
||||
|
||||
Documentation:
|
||||
New MIPS debugging info.
|
||||
|
||||
Build and Release:
|
||||
|
||||
For more details about what has changed since the last release,
|
||||
see the git repository history. With gitweb, you can browse that
|
||||
in various levels of detail.
|
||||
|
||||
For older NEWS, see the NEWS files associated with each release
|
||||
(i.e. NEWS-<version>).
|
||||
|
||||
For more information about contributing test reports, bug fixes, or new
|
||||
features and device support, please read the new Developer Manual (or
|
||||
the BUGS and PATCHES.txt files in the source archive).
|
111
NEWS-0.8.0
111
NEWS-0.8.0
|
@ -1,111 +0,0 @@
|
|||
This file includes highlights of the changes made in the OpenOCD
|
||||
source archive release.
|
||||
|
||||
JTAG Layer:
|
||||
* New CMSIS-DAP driver
|
||||
* Andes AICE debug adapter support
|
||||
* New OpenJTAG driver
|
||||
* New BCM2835 (RaspberryPi) driver
|
||||
* JTAG VPI client driver (for OpenRISC Reference Platform SoC)
|
||||
* Xilinx BSCAN_* for OpenRISC support
|
||||
* ST-LINKv2-1 support
|
||||
* ST-LINKv2 SWO tracing support (UART emulation)
|
||||
* JLink-OB (onboard) support
|
||||
* Altera USB Blaster driver rewrite, initial Blaster II
|
||||
support
|
||||
* ULINK driver ported to libusb-1.0, OpenULINK build fixes
|
||||
* Support up to 64 bit IR lengths
|
||||
* SVF playback (FPGA programming) fixes
|
||||
* "ftdi" interface driver got extensive testing and is now
|
||||
recommended over the old ft2232 implementation
|
||||
|
||||
Boundary Scan:
|
||||
|
||||
Target Layer:
|
||||
* New target: Andes nds32
|
||||
* New target: OpenRISC OR1K
|
||||
* New target: Intel Quark X10xx
|
||||
* MIPS EJTAG 1.5/2.0 support
|
||||
* MIPS speed improvements
|
||||
* Cortex-M, Cortex-A (MEM-AP, APB-AP) targets working with BE
|
||||
hosts now
|
||||
* XScale vector_catch support, reset fixes
|
||||
* dsp563xx ad-hoc breakpoint/watchpoint support
|
||||
* RTOS support for embKernel
|
||||
* Target profiling improvements
|
||||
* Memory access functions testbench
|
||||
|
||||
Flash Layer:
|
||||
* STM32 family sync with reference manuals, other bugfixes
|
||||
* STM32F401, STM32F07x support
|
||||
* Atmel SAM4L, SAMG5x support
|
||||
* at91sam3sd8{a,b}, at91sam3s8{a,b,c}, at91sam4s,
|
||||
at91sam3n0{a,b,0a,0b} support, bugfixes
|
||||
* Atmel SAMD support
|
||||
* Milandr 1986ВЕ* support
|
||||
* Kinetis KL, K21 support
|
||||
* Nuvoton NuMicro MINI5{1,2,4} support
|
||||
* Nuvoton NUC910 series support
|
||||
* NXP LPC43xx, LPC2000 fixes
|
||||
* NXP LPC800, LPC810 support
|
||||
* More ATmega parts supported
|
||||
* Fujitsu MB9Ax family support
|
||||
* EFM32 Wonder Gecko family support
|
||||
* Nordic nRF51 support
|
||||
|
||||
Board, Target, and Interface Configuration Scripts:
|
||||
* STM32W108xx generic target config
|
||||
* STM32F429 discovery board config
|
||||
* STM32 Nucleo boards configs
|
||||
* DENX M53EVK board config
|
||||
* Altera Cyclone V SoC, SoCkit config
|
||||
* New TI Launchpads board configs
|
||||
* TI am43xx devices, AM437x GP EVM, AM438x ePOS EVM board
|
||||
configs
|
||||
* Marvell Armada 370 family initial support
|
||||
* TI TMDX570LS31USB (TMS570, Cortex-R4) support scripts
|
||||
* Freescale FRDM-KL25Z, KL46Z board configs
|
||||
* Digilent Zedboard config
|
||||
* Asus RT-N16, Linksys WRT54GL, BT HomeHub board configs
|
||||
* Atmel Xplained initial support
|
||||
* Broadcom bcm28155_ap board config
|
||||
* TUMPA, TUMPA Lite interface configs
|
||||
* Digilent JTAG-SMT2 interface config
|
||||
* New RAM testing functions
|
||||
* Easy-to-use firmware recovery helpers targetting ordinary
|
||||
users with common equipment
|
||||
|
||||
Server Layer:
|
||||
* Auto-generation of GDB target description for ARMv7-M,
|
||||
ARM4, nds32, OR1K, Quark
|
||||
* GDB File-I/O Remote Protocol extension support
|
||||
* Default GDB flashing events handlers to initialise and reset
|
||||
the target automatically when "load" is used
|
||||
|
||||
Documentation:
|
||||
* Extensive README* changes
|
||||
* The official User's Guide was proofread
|
||||
* Example cross-build script
|
||||
* RTOS documentation improvements
|
||||
* Tcl RPC documentation and examples added
|
||||
|
||||
Build and Release:
|
||||
* *BSD, OS X, clang, ARM, windows build fixes
|
||||
* New pkg-config support changes the way libusb (and other
|
||||
dependencies) are handled. Many adapter drivers are now
|
||||
selected automatically during the configure stage.
|
||||
|
||||
|
||||
This release also contains a number of other important functional and
|
||||
cosmetic bugfixes. For more details about what has changed since the
|
||||
last release, see the git repository history:
|
||||
|
||||
http://sourceforge.net/p/openocd/code/ci/v0.8.0/log/?path=
|
||||
|
||||
|
||||
For older NEWS, see the NEWS files associated with each release
|
||||
(i.e. NEWS-<version>).
|
||||
|
||||
For more information about contributing test reports, bug fixes, or new
|
||||
features and device support, please read the new Developer Manual (or
|
||||
the BUGS and PATCHES.txt files in the source archive).
|
110
NEWS-0.9.0
110
NEWS-0.9.0
|
@ -1,110 +0,0 @@
|
|||
This file includes highlights of the changes made in the OpenOCD
|
||||
source archive release.
|
||||
|
||||
JTAG Layer:
|
||||
* SWD support with FTDI, Versaloon, J-Link, sysfsgpio
|
||||
* CMSIS-DAP massive speed and stability improvements
|
||||
* Versaloon driver ported to libusb-1.0
|
||||
* STLink can reestablish communication with a target that was
|
||||
disconnected or rebooted
|
||||
* STLink FAULT and WAIT SWD handling improved
|
||||
* New hla_serial command to distinguish between several HLA
|
||||
adapters attached to a single machine
|
||||
* Serial number support for CMSIS-DAP and J-Link adapters
|
||||
* Support for more J-Link adapters
|
||||
* TAP autoprobing improvements
|
||||
* Big speedup for SVF playback with USB Blaster
|
||||
|
||||
Boundary Scan:
|
||||
|
||||
Target Layer:
|
||||
* Stability improvements for targets that get disconnected or
|
||||
rebooted during a debug session
|
||||
* MIPS speed and reliability improvements
|
||||
* MIPS 1.5/2.0 fixes
|
||||
* ARMv7-R improvements
|
||||
* Cortex-A improvements, A7, A15 MPCores support
|
||||
* FPU support for ARMv7-M (Cortex-M4F)
|
||||
* TPIU/ITM support (including SWO/SWV tracing), can be
|
||||
captured with external tools or STLink
|
||||
* JTAG Serial Port (Advanced Debug System softcore) support
|
||||
* Profiling support for OpenRISC
|
||||
* ChibiOS/RT 3.0 support (with and without FPU)
|
||||
* FreeRTOS current versions support
|
||||
* Freescale MQX RTOS support
|
||||
* GDB target description support for MIPS
|
||||
* The last created target is auto-selected as the current
|
||||
|
||||
Flash Layer:
|
||||
* nRF51 async loader to improve flashing performance and stability
|
||||
* Cypress PSoC 41xx/42xx and CCG1 families flash driver
|
||||
* Silabs SiM3 family flash driver
|
||||
* Marvell Wireless Microcontroller SPI flash driver
|
||||
* Kinetis mass erase (part unsecuring) implemented
|
||||
* lpcspifi stability fixes
|
||||
* STM32 family sync with reference manuals, L0 support, bugfixes
|
||||
* LPC2000 driver automatically determines part and flash size
|
||||
* NXP LPC11(x)xx, LPC13xx, LPC15xx, LPC8xx, LPC5410x, LPC407x support
|
||||
* Atmel SAMD, SAMR, SAML21 devices support
|
||||
* Atmel SAM4E16 support
|
||||
* ZeroGecko family support
|
||||
* TI Tiva C Blizzard and Snowflake families support
|
||||
* Nuvoton NuMicro M051 support
|
||||
* EZR32 support in EFM32 driver
|
||||
|
||||
Board, Target, and Interface Configuration Scripts:
|
||||
* Normal target configs can work with HLA (STLink, ICDI) adapters
|
||||
* STM32 discovery and Nucleo boards configs
|
||||
* Gumstix AeroCore board config
|
||||
* General Plus GP326XXXA target config
|
||||
* Micrel KS869x target config
|
||||
* ASUS RT-N66U board config
|
||||
* Atmel SAM4E-EK board config
|
||||
* Atmel AT91SAM4L proper reset handling implemented
|
||||
* TI OMAP/AM 3505, 3517 target configs
|
||||
* nRF51822-mKIT board config
|
||||
* RC Module К1879ХБ1Я target config
|
||||
* TI TMDX570LS20SUSB board config
|
||||
* TI TMS570 USB Kit board config
|
||||
* TI CC2538, CC26xx target configs
|
||||
* TI AM437x major config improvements, DDR support
|
||||
* TI AM437X IDK board config
|
||||
* TI SimpleLink Wi-Fi CC3200 LaunchPad configs
|
||||
* Silicon Labs EM357, EM358 target configs
|
||||
* Infineon XMC1000, XMC4000 family targets and boards configs
|
||||
* Atheros AR9331 target config
|
||||
* TP-LINK TL-MR3020 board config
|
||||
* Alphascale asm9260t target and eval kit configs
|
||||
* Olimex SAM7-LA2 (AT91SAM7A2) board config
|
||||
* EFM32 Gecko boards configs
|
||||
* Spansion FM4 target and SK-FM4-176L-S6E2CC board configs
|
||||
* LPC1xxx target configs were restructured
|
||||
* IoT-LAB debug adapter config
|
||||
* DP BusBlaster KT-Link compatible config
|
||||
|
||||
Server Layer:
|
||||
* Polling period can be configured
|
||||
* "shutdown" command has an immediate effect
|
||||
* The "program" command doesn't lead to a shutdown by
|
||||
default, use optional "exit" parameter for the old behaviour
|
||||
* Proper OS signal handling was implemented
|
||||
* Async target notifications for the Tcl RPC
|
||||
|
||||
Documentation:
|
||||
|
||||
Build and Release:
|
||||
|
||||
|
||||
This release also contains a number of other important functional and
|
||||
cosmetic bugfixes. For more details about what has changed since the
|
||||
last release, see the git repository history:
|
||||
|
||||
http://sourceforge.net/p/openocd/code/ci/v0.9.0/log/?path=
|
||||
|
||||
|
||||
For older NEWS, see the NEWS files associated with each release
|
||||
(i.e. NEWS-<version>).
|
||||
|
||||
For more information about contributing test reports, bug fixes, or new
|
||||
features and device support, please read the new Developer Manual (or
|
||||
the BUGS and PATCHES.txt files in the source archive).
|
2
NEWTAPS
2
NEWTAPS
|
@ -77,7 +77,7 @@ This is always a 32bit hex number.
|
|||
Examples:
|
||||
0x1f0f0f0f - is an old ARM7TDMI
|
||||
0x3f0f0f0f - is a newer ARM7TDMI
|
||||
0x3ba00477 - is an ARM Cortex-M3
|
||||
0x3ba00477 - is an ARM cortex M3
|
||||
|
||||
Some chips have multiple JTAG taps - be sure to list
|
||||
each one individually - ORDER is important!
|
||||
|
|
505
README
505
README
|
@ -2,70 +2,36 @@ Welcome to OpenOCD!
|
|||
===================
|
||||
|
||||
OpenOCD provides on-chip programming and debugging support with a
|
||||
layered architecture of JTAG interface and TAP support including:
|
||||
|
||||
- (X)SVF playback to facilitate automated boundary scan and FPGA/CPLD
|
||||
programming;
|
||||
- debug target support (e.g. ARM, MIPS): single-stepping,
|
||||
breakpoints/watchpoints, gprof profiling, etc;
|
||||
- flash chip drivers (e.g. CFI, NAND, internal flash);
|
||||
- embedded TCL interpreter for easy scripting.
|
||||
|
||||
Several network interfaces are available for interacting with OpenOCD:
|
||||
telnet, TCL, and GDB. The GDB server enables OpenOCD to function as a
|
||||
"remote target" for source-level debugging of embedded systems using
|
||||
the GNU GDB program (and the others who talk GDB protocol, e.g. IDA
|
||||
Pro).
|
||||
layered architecture of JTAG interface and TAP support, debug target
|
||||
support (e.g. ARM, MIPS), and flash chip drivers (e.g. CFI, NAND, etc.).
|
||||
Several network interfaces are available for interactiving with OpenOCD:
|
||||
HTTP, telnet, TCL, and GDB. The GDB server enables OpenOCD to function
|
||||
as a "remote target" for source-level debugging of embedded systems
|
||||
using the GNU GDB program.
|
||||
|
||||
This README file contains an overview of the following topics:
|
||||
|
||||
- quickstart instructions,
|
||||
- how to find and build more OpenOCD documentation,
|
||||
- list of the supported hardware,
|
||||
- the installation and build process,
|
||||
- the build process
|
||||
- packaging tips.
|
||||
|
||||
|
||||
============================
|
||||
Quickstart for the impatient
|
||||
============================
|
||||
|
||||
If you have a popular board then just start OpenOCD with its config,
|
||||
e.g.:
|
||||
|
||||
openocd -f board/stm32f4discovery.cfg
|
||||
|
||||
If you are connecting a particular adapter with some specific target,
|
||||
you need to source both the jtag interface and the target configs,
|
||||
e.g.:
|
||||
|
||||
openocd -f interface/ftdi/jtagkey2.cfg -c "transport select jtag" \
|
||||
-f target/ti_calypso.cfg
|
||||
|
||||
openocd -f interface/stlink.cfg -c "transport select hla_swd" \
|
||||
-f target/stm32l0.cfg
|
||||
|
||||
After OpenOCD startup, connect GDB with
|
||||
|
||||
(gdb) target extended-remote localhost:3333
|
||||
|
||||
- configuration options
|
||||
|
||||
=====================
|
||||
OpenOCD Documentation
|
||||
=====================
|
||||
|
||||
In addition to the in-tree documentation, the latest manuals may be
|
||||
viewed online at the following URLs:
|
||||
In addition to in-tree documentation, the latest documentation may be
|
||||
viewed on-line at the following URLs:
|
||||
|
||||
OpenOCD User's Guide:
|
||||
http://openocd.org/doc/html/index.html
|
||||
OpenOCD User's Guide:
|
||||
http://openocd.sourceforge.net/doc/html/index.html
|
||||
|
||||
OpenOCD Developer's Manual:
|
||||
http://openocd.org/doc/doxygen/html/index.html
|
||||
OpenOCD Developer's Manual:
|
||||
http://openocd.sourceforge.net/doc/doxygen/html/index.html
|
||||
|
||||
These reflect the latest development versions, so the following section
|
||||
introduces how to build the complete documentation from the package.
|
||||
|
||||
|
||||
For more information, refer to these documents or contact the developers
|
||||
by subscribing to the OpenOCD developer mailing list:
|
||||
|
||||
|
@ -74,12 +40,7 @@ by subscribing to the OpenOCD developer mailing list:
|
|||
Building the OpenOCD Documentation
|
||||
----------------------------------
|
||||
|
||||
By default the OpenOCD build process prepares documentation in the
|
||||
"Info format" and installs it the standard way, so that "info openocd"
|
||||
can access it.
|
||||
|
||||
Additionally, the OpenOCD User's Guide can be produced in the
|
||||
following different formats:
|
||||
The OpenOCD User's Guide can be produced in two different format:
|
||||
|
||||
# If PDFVIEWER is set, this creates and views the PDF User Guide.
|
||||
make pdf && ${PDFVIEWER} doc/openocd.pdf
|
||||
|
@ -91,56 +52,24 @@ The OpenOCD Developer Manual contains information about the internal
|
|||
architecture and other details about the code:
|
||||
|
||||
# NB! make sure doxygen is installed, type doxygen --version
|
||||
make doxygen && ${HTMLVIEWER} doxygen/index.html
|
||||
make doxygen
|
||||
|
||||
# If HTMLVIEWER is set, this views the HTML Doxygen output.
|
||||
${HTMLVIEWER} doxygen/index.html
|
||||
|
||||
==================
|
||||
Supported hardware
|
||||
==================
|
||||
|
||||
JTAG adapters
|
||||
-------------
|
||||
|
||||
AICE, ARM-JTAG-EW, ARM-USB-OCD, ARM-USB-TINY, AT91RM9200, axm0432, BCM2835,
|
||||
Bus Blaster, Buspirate, Cadence DPI, Chameleon, CMSIS-DAP, Cortino,
|
||||
Cypress KitProg, DENX, Digilent JTAG-SMT2, DLC 5, DLP-USB1232H,
|
||||
embedded projects, eStick, FlashLINK, FlossJTAG, Flyswatter, Flyswatter2,
|
||||
FTDI FT232R, Gateworks, Hoegl, ICDI, ICEBear, J-Link, JTAG VPI, JTAGkey,
|
||||
JTAGkey2, JTAG-lock-pick, KT-Link, Linux GPIOD, Lisa/L, LPC1768-Stick,
|
||||
Mellanox rshim, MiniModule, NGX, Nuvoton Nu-Link, Nu-Link2, NXHX, NXP IMX GPIO,
|
||||
OOCDLink, Opendous, OpenJTAG, Openmoko, OpenRD, OSBDM, Presto, Redbee,
|
||||
Remote Bitbang, RLink, SheevaPlug devkit, Stellaris evkits,
|
||||
ST-LINK (SWO tracing supported), STM32-PerformanceStick, STR9-comStick,
|
||||
sysfsgpio, TI XDS110, TUMPA, Turtelizer, ULINK, USB-A9260, USB-Blaster,
|
||||
USB-JTAG, USBprog, VPACLink, VSLLink, Wiggler, XDS100v2, Xilinx XVC/PCIe,
|
||||
Xverve.
|
||||
|
||||
Debug targets
|
||||
-------------
|
||||
|
||||
ARM: AArch64, ARM11, ARM7, ARM9, Cortex-A/R (v7-A/R), Cortex-M (ARMv{6/7/8}-M),
|
||||
FA526, Feroceon/Dragonite, XScale.
|
||||
ARCv2, AVR32, DSP563xx, DSP5680xx, EnSilica eSi-RISC, EJTAG (MIPS32, MIPS64),
|
||||
Intel Quark, LS102x-SAP, NDS32, RISC-V, ST STM8.
|
||||
|
||||
Flash drivers
|
||||
-------------
|
||||
|
||||
ADUC702x, AT91SAM, AT91SAM9 (NAND), ATH79, ATmega128RFA1, Atmel SAM, AVR, CFI,
|
||||
DSP5680xx, EFM32, EM357, eSi-RISC, eSi-TSMC, EZR32HG, FM3, FM4, Freedom E SPI,
|
||||
i.MX31, Kinetis, LPC8xx/LPC1xxx/LPC2xxx/LPC541xx, LPC2900, LPC3180, LPC32xx,
|
||||
LPCSPIFI, Marvell QSPI, MAX32, Milandr, MXC, NIIET, nRF51, nRF52 , NuMicro,
|
||||
NUC910, Orion/Kirkwood, PIC32mx, PSoC4/5LP/6, Renesas RPC HF and SH QSPI,
|
||||
S3C24xx, S3C6400, SiM3x, SiFive Freedom E, Stellaris, ST BlueNRG, STM32,
|
||||
STM32 QUAD/OCTO-SPI for Flash/FRAM/EEPROM, STMSMI, STR7x, STR9x, SWM050,
|
||||
TI CC13xx, TI CC26xx, TI CC32xx, TI MSP432, Winner Micro w600, Xilinx XCF,
|
||||
XMC1xxx, XMC4xxx.
|
||||
|
||||
The remaining sections describe how to configure the system such that
|
||||
you can build the in-tree documentation.
|
||||
|
||||
==================
|
||||
Installing OpenOCD
|
||||
==================
|
||||
|
||||
On Linux, you may have permissions problems to address. The best way
|
||||
to do this is to use the contrib/openocd.udev rules file. It probably
|
||||
belongs somewhere in /etc/udev/rules.d, but consult your operating
|
||||
system documentation to be sure. In particular, make sure that it
|
||||
matches the syntax used by your operating system's version of udev.
|
||||
|
||||
A Note to OpenOCD Users
|
||||
-----------------------
|
||||
|
||||
|
@ -148,14 +77,13 @@ If you would rather be working "with" OpenOCD rather than "on" it, your
|
|||
operating system or JTAG interface supplier may provide binaries for
|
||||
you in a convenient-enough package.
|
||||
|
||||
Such packages may be more stable than git mainline, where
|
||||
bleeding-edge development takes place. These "Packagers" produce
|
||||
binary releases of OpenOCD after the developers produces new "release"
|
||||
versions of the source code. Previous versions of OpenOCD cannot be
|
||||
used to diagnose problems with the current release, so users are
|
||||
encouraged to keep in contact with their distribution package
|
||||
maintainers or interface vendors to ensure suitable upgrades appear
|
||||
regularly.
|
||||
Such packages may be more stable than git mainline, where bleeding-edge
|
||||
development takes place. These "Packagers" produce binary releases of
|
||||
OpenOCD after the developers produces new "release" versions of the
|
||||
source code. Previous versions of OpenOCD cannot be used to diagnose
|
||||
problems with the current release, so users are encouraged to keep in
|
||||
contact with their distribution package maintainers or interface vendors
|
||||
to ensure suitable upgrades appear regularly.
|
||||
|
||||
Users of these binary versions of OpenOCD must contact their Packager to
|
||||
ask for support or newer versions of the binaries; the OpenOCD
|
||||
|
@ -166,9 +94,10 @@ A Note to OpenOCD Packagers
|
|||
|
||||
You are a PACKAGER of OpenOCD if you:
|
||||
|
||||
- Sell dongles and include pre-built binaries;
|
||||
- Supply tools or IDEs (a development solution integrating OpenOCD);
|
||||
- Build packages (e.g. RPM or DEB files for a GNU/Linux distribution).
|
||||
- Sell dongles: and include pre-built binaries
|
||||
- Supply tools: A complete development solution
|
||||
- Supply IDEs: like Eclipse, or RHIDE, etc.
|
||||
- Build packages: RPM files, or DEB files for a Linux Distro
|
||||
|
||||
As a PACKAGER, you will experience first reports of most issues.
|
||||
When you fix those problems for your users, your solution may help
|
||||
|
@ -182,21 +111,21 @@ resolved in our future releases.
|
|||
That said, the OpenOCD developers would also like you to follow a few
|
||||
suggestions:
|
||||
|
||||
- Send patches, including config files, upstream, participate in the
|
||||
discussions;
|
||||
- Enable all the options OpenOCD supports, even those unrelated to your
|
||||
particular hardware;
|
||||
- Use "ftdi" interface adapter driver for the FTDI-based devices.
|
||||
- Send patches, including config files, upstream.
|
||||
- Always build with printer ports enabled.
|
||||
- Use libftdi + libusb for FT2232 support.
|
||||
|
||||
Remember, the FTD2XX library cannot be used in binary distributions, due
|
||||
to restrictions of the GPL v2.
|
||||
|
||||
================
|
||||
Building OpenOCD
|
||||
================
|
||||
|
||||
The INSTALL file contains generic instructions for running 'configure'
|
||||
and compiling the OpenOCD source code. That file is provided by
|
||||
default for all GNU autotools packages. If you are not familiar with
|
||||
the GNU autotools, then you should read those instructions first.
|
||||
and compiling the OpenOCD source code. That file is provided by default
|
||||
for all GNU automake packages. If you are not familiar with the GNU
|
||||
autotools, then you should read those instructions first.
|
||||
|
||||
The remainder of this document tries to provide some instructions for
|
||||
those looking for a quick-install.
|
||||
|
@ -204,107 +133,282 @@ those looking for a quick-install.
|
|||
OpenOCD Dependencies
|
||||
--------------------
|
||||
|
||||
GCC or Clang is currently required to build OpenOCD. The developers
|
||||
have begun to enforce strict code warnings (-Wall, -Werror, -Wextra,
|
||||
and more) and use C99-specific features: inline functions, named
|
||||
initializers, mixing declarations with code, and other tricks. While
|
||||
it may be possible to use other compilers, they must be somewhat
|
||||
modern and could require extending support to conditionally remove
|
||||
GCC-specific extensions.
|
||||
Presently, GCC is required to build OpenOCD. The developers have begun
|
||||
to enforce strict code warnings (-Wall, -Werror, -Wextra, and more) and
|
||||
use C99-specific features: inline functions, named initializers, mixing
|
||||
declarations with code, and other tricks. While it may be possible to
|
||||
use other compilers, they must be somewhat modern and could require
|
||||
extending support to conditionally remove GCC-specific extensions.
|
||||
|
||||
You'll also need:
|
||||
Also, you need to install the appropriate driver files, if you want to
|
||||
build support for a USB or FTDI-based interface:
|
||||
|
||||
- make
|
||||
- libtool
|
||||
- pkg-config >= 0.23 (or compatible)
|
||||
- ft2232, jlink, rlink, vsllink, usbprog, arm-jtag-ew:
|
||||
- libusb: required for portable communication with USB dongles
|
||||
- ft2232 also requires:
|
||||
- libftdi: http://www.intra2net.com/opensource/ftdi/ *OR*
|
||||
- ftd2xx: http://www.ftdichip.com/Drivers/D2XX.htm,
|
||||
or the Amontec version (from http://www.amontec.com), for
|
||||
easier support of JTAGkey's vendor and product IDs.
|
||||
|
||||
Additionally, for building from git:
|
||||
|
||||
- autoconf >= 2.69
|
||||
- automake >= 1.14
|
||||
- texinfo >= 5.0
|
||||
|
||||
USB-based adapters depend on libusb-1.0. A compatible implementation, such as
|
||||
FreeBSD's, additionally needs the corresponding .pc files.
|
||||
|
||||
USB-Blaster, ASIX Presto and OpenJTAG interface adapter
|
||||
drivers need:
|
||||
- libftdi: http://www.intra2net.com/en/developer/libftdi/index.php
|
||||
|
||||
CMSIS-DAP support needs HIDAPI library.
|
||||
|
||||
Permissions delegation
|
||||
----------------------
|
||||
|
||||
Running OpenOCD with root/administrative permissions is strongly
|
||||
discouraged for security reasons.
|
||||
|
||||
For USB devices on GNU/Linux you should use the contrib/60-openocd.rules
|
||||
file. It probably belongs somewhere in /etc/udev/rules.d, but
|
||||
consult your operating system documentation to be sure. Do not forget
|
||||
to add yourself to the "plugdev" group.
|
||||
|
||||
For parallel port adapters on GNU/Linux and FreeBSD please change your
|
||||
"ppdev" (parport* or ppi*) device node permissions accordingly.
|
||||
|
||||
For parport adapters on Windows you need to run install_giveio.bat
|
||||
(it's also possible to use "ioperm" with Cygwin instead) to give
|
||||
ordinary users permissions for accessing the "LPT" registers directly.
|
||||
Many Linux distributions provide these packages through their automated
|
||||
installation and update mechanisms; however, some Linux versions include
|
||||
older versions of libftdi. In particular, using Ubuntu 8.04 has been
|
||||
problematic, but newer versions of Ubuntu do not have this problem.
|
||||
|
||||
Compiling OpenOCD
|
||||
-----------------
|
||||
|
||||
To build OpenOCD, use the following sequence of commands:
|
||||
To build OpenOCD (on both Linux and Cygwin), use the following sequence
|
||||
of commands:
|
||||
|
||||
./bootstrap (when building from the git repository)
|
||||
./configure [options]
|
||||
make
|
||||
sudo make install
|
||||
./configure [with some options listed in the next section]
|
||||
make
|
||||
make install
|
||||
|
||||
The 'configure' step generates the Makefiles required to build
|
||||
OpenOCD, usually with one or more options provided to it. The first
|
||||
'make' step will build OpenOCD and place the final executable in
|
||||
'./src/'. The final (optional) step, ``make install'', places all of
|
||||
the files in the required location.
|
||||
The 'configure' step generates the Makefiles required to build OpenOCD,
|
||||
usually with one or more options provided to it. The first 'make' step
|
||||
will build OpenOCD and place the final executable in ./src/. The
|
||||
final (optional) step, ``make install'', places all of the files in the
|
||||
required location.
|
||||
|
||||
To see the list of all the supported options, run
|
||||
./configure --help
|
||||
|
||||
Cross-compiling Options
|
||||
Cross-Compiling Options
|
||||
-----------------------
|
||||
|
||||
Cross-compiling is supported the standard autotools way, you just need
|
||||
to specify the cross-compiling target triplet in the --host option,
|
||||
e.g. for cross-building for Windows 32-bit with MinGW on Debian:
|
||||
To cross-compile, you must specify both --build and --host options to
|
||||
the 'configure' script. For example, you can configure OpenOCD to
|
||||
cross-compile on a x86 Linux host to run on Windows (MinGW32), you could
|
||||
use the following configuration options:
|
||||
|
||||
./configure --host=i686-w64-mingw32 [options]
|
||||
./configure --build=i686-pc-linux-gnu --host=i586-mingw32msvc ...
|
||||
|
||||
To make pkg-config work nicely for cross-compiling, you might need an
|
||||
additional wrapper script as described at
|
||||
Likewise, the following options allow OpenOCD to be cross-compiled for
|
||||
an ARM target on the same x86 host:
|
||||
|
||||
https://autotools.io/pkgconfig/cross-compiling.html
|
||||
./configure --build=i686-pc-linux-gnu --host=arm-elf ...
|
||||
|
||||
This is needed to tell pkg-config where to look for the target
|
||||
libraries that OpenOCD depends on. Alternatively, you can specify
|
||||
*_CFLAGS and *_LIBS environment variables directly, see "./configure
|
||||
--help" for the details.
|
||||
Both must be specified to work around bugs in autoconf.
|
||||
|
||||
For a more or less complete script that does all this for you, see
|
||||
Scripts for producing ARM cross-compilers can be found on the web with a
|
||||
little searching. A script to produce an x86 Linux-hosted MinGW32
|
||||
cross-compiler can be downloaded from the following URL:
|
||||
|
||||
contrib/cross-build.sh
|
||||
http://www.mingw.org/wiki/LinuxCrossMinGW
|
||||
|
||||
Configuration Options
|
||||
---------------------
|
||||
|
||||
The configure script takes numerous options, specifying which JTAG
|
||||
interfaces should be included (among other things). The following list
|
||||
of options was extracted from the output of './configure --help'. Other
|
||||
options may be available there:
|
||||
|
||||
--enable-maintainer-mode enable make rules and dependencies not useful
|
||||
(and sometimes confusing) to the casual installer
|
||||
NOTE: This option is *required* for GIT builds!
|
||||
It should *not* be used to build a release.
|
||||
|
||||
--enable-dummy Enable building the dummy JTAG port driver
|
||||
|
||||
--enable-parport Enable building the pc parallel port driver
|
||||
--disable-parport-ppdev Disable use of ppdev (/dev/parportN) for parport
|
||||
(for x86 only)
|
||||
--enable-parport-giveio Enable use of giveio for parport (for CygWin only)
|
||||
|
||||
|
||||
--enable-ft2232_libftdi Enable building support for FT2232 based devices
|
||||
using the libftdi driver, opensource alternate of
|
||||
FTD2XX
|
||||
--enable-ft2232_ftd2xx Enable building support for FT2232 based devices
|
||||
using the FTD2XX driver from ftdichip.com
|
||||
|
||||
--enable-usb_blaster_libftdi
|
||||
Enable building support for the Altera USB-Blaster
|
||||
using the libftdi driver, opensource alternate of
|
||||
FTD2XX
|
||||
--enable-usb_blaster_ftd2xx
|
||||
Enable building support for the Altera USB-Blaster
|
||||
using the FTD2XX driver from ftdichip.com
|
||||
|
||||
--enable-amtjtagaccel Enable building the Amontec JTAG-Accelerator driver
|
||||
|
||||
--enable-zy1000-master Use ZY1000 JTAG master registers
|
||||
--enable-zy1000 Enable ZY1000 interface
|
||||
|
||||
--enable-ioutil Enable ioutil functions - useful for standalone
|
||||
OpenOCD implementations
|
||||
|
||||
--enable-ep93xx Enable building support for EP93xx based SBCs
|
||||
|
||||
--enable-at91rm9200 Enable building support for AT91RM9200 based SBCs
|
||||
|
||||
--enable-gw16012 Enable building support for the Gateworks GW16012
|
||||
JTAG Programmer
|
||||
|
||||
--enable-presto_libftdi Enable building support for ASIX Presto Programmer
|
||||
using the libftdi driver
|
||||
--enable-presto_ftd2xx Enable building support for ASIX Presto Programmer
|
||||
using the FTD2XX driver
|
||||
|
||||
--enable-usbprog Enable building support for the usbprog JTAG
|
||||
Programmer
|
||||
|
||||
--enable-oocd_trace Enable building support for some prototype
|
||||
OpenOCD+trace ETM capture hardware
|
||||
|
||||
--enable-jlink Enable building support for the Segger J-Link JTAG
|
||||
Programmer
|
||||
|
||||
--enable-vsllink Enable building support for the Versaloon-Link JTAG
|
||||
Programmer
|
||||
|
||||
--enable-rlink Enable building support for the Raisonance RLink
|
||||
JTAG Programmer
|
||||
--enable-ulink Enable building support for the Keil ULINK JTAG
|
||||
Programmer
|
||||
--enable-arm-jtag-ew Enable building support for the Olimex ARM-JTAG-EW
|
||||
Programmer
|
||||
|
||||
--enable-buspirate Enable building support for the Buspirate
|
||||
|
||||
--enable-stlink Enable building support for the ST-Link JTAG
|
||||
Programmer
|
||||
|
||||
--enable-osbdm Enable building support for the OSBDM (JTAG only)
|
||||
Programmer
|
||||
|
||||
--enable-opendous Enable building support for the estick/opendous JTAG
|
||||
Programmer
|
||||
|
||||
--enable-minidriver-dummy
|
||||
Enable the dummy minidriver.
|
||||
|
||||
--disable-internal-jimtcl
|
||||
Disable building internal jimtcl
|
||||
--enable-libusb0 Use libusb-0.1 library for USB JTAG devices
|
||||
--enable-remote-bitbang Enable building support for the Remote Bitbang jtag
|
||||
driver
|
||||
|
||||
--disable-doxygen-html Disable building Doxygen manual as HTML.
|
||||
--enable-doxygen-pdf Enable building Doxygen manual as PDF.
|
||||
|
||||
Miscellaneous Configure Options
|
||||
-------------------------------
|
||||
|
||||
The following additional options may also be useful:
|
||||
|
||||
--disable-assert turn off assertions
|
||||
|
||||
--enable-verbose Enable verbose JTAG I/O messages (for debugging).
|
||||
--enable-verbose-jtag-io
|
||||
Enable verbose JTAG I/O messages (for debugging).
|
||||
--enable-verbose-usb-io Enable verbose USB I/O messages (for debugging)
|
||||
--enable-verbose-usb-comms
|
||||
Enable verbose USB communication messages (for
|
||||
debugging)
|
||||
--enable-malloc-logging Include free space in logging messages (requires
|
||||
malloc.h).
|
||||
|
||||
--disable-gccwarnings Disable extra gcc warnings during build.
|
||||
--disable-wextra Disable extra compiler warnings
|
||||
--disable-werror Do not treat warnings as errors
|
||||
|
||||
--disable-option-checking
|
||||
Ignore unrecognized --enable and --with options.
|
||||
--disable-dependency-tracking speeds up one-time build
|
||||
--enable-shared[=PKGS] build shared libraries [default=no]
|
||||
--enable-static[=PKGS] build static libraries [default=yes]
|
||||
|
||||
Parallel Port Dongles
|
||||
---------------------
|
||||
|
||||
If you want to access the parallel port using the PPDEV interface you
|
||||
have to specify both --enable-parport AND --enable-parport-ppdev, since
|
||||
the later option is an option to the parport driver.
|
||||
have to specify both --enable-parport AND --enable-parport-ppdev, since the
|
||||
the later option is an option to the parport driver (see
|
||||
http://forum.sparkfun.com/viewtopic.php?t=3795 for more info).
|
||||
|
||||
The same is true for the --enable-parport-giveio option, you have to
|
||||
use both the --enable-parport AND the --enable-parport-giveio option
|
||||
if you want to use giveio instead of ioperm parallel port access
|
||||
The same is true for the --enable-parport-giveio option, you
|
||||
have to use both the --enable-parport AND the --enable-parport-giveio
|
||||
option if you want to use giveio instead of ioperm parallel port access
|
||||
method.
|
||||
|
||||
FT2232C Based USB Dongles
|
||||
-------------------------
|
||||
|
||||
There are 2 methods of using the FTD2232, either (1) using the
|
||||
FTDICHIP.COM closed source driver, or (2) the open (and free) driver
|
||||
libftdi.
|
||||
|
||||
Using LIBFTDI
|
||||
-------------
|
||||
|
||||
The libftdi source code can be download from the following website:
|
||||
|
||||
http://www.intra2net.com/en/developer/libftdi/download.php
|
||||
|
||||
For both Linux and Windows, both libusb and libftdi must be built and
|
||||
installed. To use the newer FT2232H chips, supporting RTCK and USB high
|
||||
speed (480 Mbps), use libftdi version 0.17 or newer. Many Linux
|
||||
distributions provide suitable packages for these libraries.
|
||||
|
||||
For Windows, libftdi is supported with versions 0.14 and later.
|
||||
|
||||
With these prerequisites met, configure the libftdi solution like this:
|
||||
|
||||
./configure --prefix=/path/for/your/install --enable-ft2232_libftdi
|
||||
|
||||
Then type ``make'', and perhaps ``make install''.
|
||||
|
||||
Using FTDI's FTD2XX
|
||||
-------------------
|
||||
|
||||
The (closed source) FTDICHIP.COM solution is faster on MS-Windows. That
|
||||
is the motivation for supporting it even though its licensing restricts
|
||||
it to non-redistributable OpenOCD binaries, and it is not available for
|
||||
all operating systems used with OpenOCD. You may, however, build such
|
||||
copies for personal use.
|
||||
|
||||
The FTDICHIP drivers come as either a (win32) ZIP file, or a (Linux)
|
||||
TAR.GZ file. You must unpack them ``some where'' convenient. As of this
|
||||
writing FTDICHIP does not supply means to install these files "in an
|
||||
appropriate place."
|
||||
|
||||
If your distribution does not package these, there are several
|
||||
'./configure' options to solve this problem:
|
||||
|
||||
--with-ftd2xx-win32-zipdir
|
||||
Where (CYGWIN/MINGW) the zip file from ftdichip.com
|
||||
was unpacked <default=search>
|
||||
--with-ftd2xx-linux-tardir
|
||||
Where (Linux/Unix) the tar file from ftdichip.com
|
||||
was unpacked <default=search>
|
||||
--with-ftd2xx-lib Use static or shared ftd2xx libs on default static
|
||||
|
||||
If you are using the FTDICHIP.COM driver, download and unpack the
|
||||
Windows or Linux FTD2xx drivers from the following location:
|
||||
|
||||
http://www.ftdichip.com/Drivers/D2XX.htm
|
||||
|
||||
Remember, this library is binary-only, while OpenOCD is licenced
|
||||
according to GNU GPLv2 without any exceptions. That means that
|
||||
_distributing_ copies of OpenOCD built with the FTDI code would violate
|
||||
the OpenOCD licensing terms.
|
||||
|
||||
Linux Notes
|
||||
***********
|
||||
|
||||
The Linux tar.gz archive contains a directory named libftd2xx0.4.16
|
||||
(or similar). Assuming that you have extracted this archive in the same
|
||||
directory as the OpenOCD package, you could configure with options like
|
||||
the following:
|
||||
|
||||
./configure \
|
||||
--enable-ft2232_ftd2xx \
|
||||
--with-ft2xx-linux-tardir=../libftd2xx0.4.16 \
|
||||
... other options ...
|
||||
|
||||
Note that on Linux there is no good reason to use these FTDI binaries;
|
||||
they are no faster (on Linux) than libftdi, and cause licensing issues.
|
||||
|
||||
==========================
|
||||
Obtaining OpenOCD From GIT
|
||||
|
@ -313,7 +417,7 @@ Obtaining OpenOCD From GIT
|
|||
You can download the current GIT version with a GIT client of your
|
||||
choice from the main repository:
|
||||
|
||||
git://git.code.sf.net/p/openocd/code
|
||||
git://openocd.git.sourceforge.net/gitroot/openocd/openocd
|
||||
|
||||
You may prefer to use a mirror:
|
||||
|
||||
|
@ -324,7 +428,7 @@ Using the GIT command line client, you might use the following command
|
|||
to set up a local copy of the current repository (make sure there is no
|
||||
directory called "openocd" in the current directory):
|
||||
|
||||
git clone git://git.code.sf.net/p/openocd/code openocd
|
||||
git clone git://openocd.git.sourceforge.net/gitroot/openocd/openocd
|
||||
|
||||
Then you can update that at your convenience using
|
||||
|
||||
|
@ -333,7 +437,20 @@ Then you can update that at your convenience using
|
|||
There is also a gitweb interface, which you can use either to browse
|
||||
the repository or to download arbitrary snapshots using HTTP:
|
||||
|
||||
http://openocd.git.sourceforge.net/git/gitweb.cgi?p=openocd/openocd
|
||||
http://repo.or.cz/w/openocd.git
|
||||
|
||||
Snapshots are compressed tarballs of the source tree, about 1.3 MBytes
|
||||
each at this writing.
|
||||
|
||||
|
||||
Tips For Building From a GIT Repository
|
||||
---------------------------------------
|
||||
|
||||
Building OpenOCD from a repository requires a recent version of the GNU
|
||||
autotools (autoconf >= 2.59 and automake >= 1.9).
|
||||
|
||||
1) Run './bootstrap' to create the 'configure' script and prepare
|
||||
the build process for your host system.
|
||||
|
||||
2) Run './configure --enable-maintainer-mode' with other options.
|
||||
|
|
|
@ -0,0 +1,98 @@
|
|||
Building OpenOCD for Windows
|
||||
----------------------------
|
||||
|
||||
For building on Windows, you have to use CygWin. Make sure that your
|
||||
PATH environment variable contains no other locations with Unix utilities
|
||||
(like UnxUtils). Those tools can't handle the CygWin paths, resulting
|
||||
in obscure dependency errors. This was an observation gathered from the
|
||||
logs of one user; please correct us if this is wrong.
|
||||
|
||||
The following URL is a good reference if you want to build OpenOCD
|
||||
under CygWin:
|
||||
|
||||
http://forum.sparkfun.com/viewtopic.php?t=11221
|
||||
|
||||
Alternatively you can build the Windows binary under Linux using
|
||||
MinGW cross compiler. The following documents some tips of
|
||||
using this cross build option.
|
||||
|
||||
libusb-win32
|
||||
------------
|
||||
|
||||
You can choose to use the libusb-win32 binary distribution from
|
||||
its SourceForge page. As of this writing, the latest version
|
||||
is 0.1.12.2. This is the recommend version to use since it fixed
|
||||
an issue with USB composite device and this is important for FTDI
|
||||
based JTAG debuggers.
|
||||
|
||||
http://sourceforge.net/projects/libusb-win32/
|
||||
|
||||
You need to download the libusb-win32-device-bin-0.1.12.2.tar.gz
|
||||
package. Extract this file into a temp directory.
|
||||
|
||||
Copy the file libusb-win32-device-bin-0.1.12.2\include\usb.h
|
||||
to your MinGW include directory.
|
||||
|
||||
Copy the library libusb-win32-device-bin-0.1.12.2\lib\gcc\libusb.a
|
||||
to your MinGW library directory.
|
||||
|
||||
Take note that different Linux distributions often have different MinGW
|
||||
installation directory. Some of them also put the library and include
|
||||
into a separate sys-root directory.
|
||||
|
||||
When the libusb-win32 repository is more current than its release code,
|
||||
you could build that instead.
|
||||
|
||||
These are the instruction from the libusb-win32 Makefile:
|
||||
|
||||
# If you're cross-compiling and your mingw32 tools are called
|
||||
# i586-mingw32msvc-gcc and so on, then you can compile libusb-win32
|
||||
# by running
|
||||
# make host_prefix=i586-mingw32msvc all
|
||||
|
||||
libftdi
|
||||
-------
|
||||
|
||||
The author does not provide Windows binary. You can build it from a
|
||||
released source tarball or the git tree.
|
||||
|
||||
If you are using the git tree, the following are the instructions from
|
||||
README.mingw. You will need to have the cmake utility installed.
|
||||
|
||||
- Edit Toolchain-mingw32.cmake to point to the correct MinGW
|
||||
installation.
|
||||
- Create a build directory like "mkdir build-win32", e.g in ../libftdi/
|
||||
- cd into that directory and run
|
||||
"cmake -DCMAKE_TOOLCHAIN_FILE=../Toolchain-mingw32.cmake .."
|
||||
- Copy src/ftdi.h to your MinGW include directory.
|
||||
- Copy build-win32/src/*.a to your MinGW lib directory.
|
||||
|
||||
libftd2xx
|
||||
---------
|
||||
|
||||
The Cygwin/Win32 ZIP file contains a directory named ftd2xx.win32.
|
||||
After being extracted, the directory does not need further preparation.
|
||||
Instead, its path must be provided to the --with-ftd2xx-win32-zipdir
|
||||
configure option, as shown in the next section.
|
||||
|
||||
OpenOCD
|
||||
-------
|
||||
|
||||
Now you can build OpenOCD under Linux using MinGW. You need to use
|
||||
--build and --host configure options.
|
||||
|
||||
To use libftdi:
|
||||
|
||||
./configure --build=i686-pc-linux-gnu --host=i586-mingw32msvc \
|
||||
--enable-ft2232_libftdi \
|
||||
... other options ...
|
||||
|
||||
To use ftd2xx:
|
||||
|
||||
./configure --build=i686-pc-linux-gnu --host=i586-mingw32msvc \
|
||||
--enable-ft2232_ftd2xx \
|
||||
--with-ftd2xx-win32-zipdir=/path/to/libftd2xx-win32 \
|
||||
... other options ...
|
||||
|
||||
If you are using the GIT repository, see the README file for additional
|
||||
instructions about configuring and building OpenOCD.
|
|
@ -1,56 +0,0 @@
|
|||
Building OpenOCD for Windows
|
||||
----------------------------
|
||||
|
||||
You can build OpenOCD for Windows natively with either MinGW-w64/MSYS
|
||||
or Cygwin (plain MinGW might work with --disable-werror but is not
|
||||
recommended as it doesn't provide enough C99 compatibility).
|
||||
Alternatively, one can cross-compile it using MinGW-w64 on a *nix
|
||||
host. See README for the generic instructions.
|
||||
|
||||
Also, the MSYS2 project provides both ready-made binaries and an easy
|
||||
way to self-compile from their software repository out of the box.
|
||||
|
||||
Native MinGW-w64/MSYS compilation
|
||||
-----------------------------
|
||||
|
||||
As MSYS doesn't come with pkg-config pre-installed, you need to add it
|
||||
manually. The easiest way to do that is to download pkg-config-lite
|
||||
from:
|
||||
|
||||
http://sourceforge.net/projects/pkgconfiglite/
|
||||
|
||||
Then simply unzip the archive to the root directory of your MinGW-w64
|
||||
installation.
|
||||
|
||||
USB adapters
|
||||
------------
|
||||
|
||||
For the adapters that use a HID-based protocol, e.g. CMSIS-DAP, you do
|
||||
not need to perform any additional configuration.
|
||||
|
||||
For all the others you usually need to have WinUSB.sys (or
|
||||
libusbK.sys) driver installed. Some vendor software (e.g. for
|
||||
ST-LINKv2) does it on its own. For the other cases the easiest way to
|
||||
assign WinUSB to a device is to use the latest Zadig installer:
|
||||
|
||||
http://zadig.akeo.ie
|
||||
|
||||
When using a composite USB device, it's often necessary to assign
|
||||
WinUSB.sys to the composite parent instead of the specific
|
||||
interface. To do that one needs to activate an advanced option in the
|
||||
Zadig installer.
|
||||
|
||||
If you need to use the same adapter with other applications that may
|
||||
require another driver, a solution for Windows Vista and above is to
|
||||
activate the IgnoreHWSerNum registry setting for the USB device.
|
||||
|
||||
That setting forces Windows to associate the driver per port instead of
|
||||
per serial number, the same behaviour as when the device does not contain
|
||||
a serial number. So different drivers can be installed for the adapter on
|
||||
different ports and you just need to plug the adapter into the correct
|
||||
port depending on which application to use.
|
||||
|
||||
For more information, see:
|
||||
|
||||
http://msdn.microsoft.com/en-us/library/windows/hardware/jj649944(v=vs.85).aspx
|
||||
http://www.ftdichip.com/Support/Knowledgebase/index.html?ignorehardwareserialnumber.htm
|
54
README.macOS
54
README.macOS
|
@ -1,54 +0,0 @@
|
|||
Building OpenOCD for macOS
|
||||
--------------------------
|
||||
|
||||
There are a few prerequisites you will need first:
|
||||
|
||||
- Xcode (install from the AppStore)
|
||||
- Command Line Tools (install from Xcode -> Preferences -> Downloads)
|
||||
- Gentoo Prefix (http://www.gentoo.org/proj/en/gentoo-alt/prefix/bootstrap.xml)
|
||||
or
|
||||
- Homebrew (http://mxcl.github.io/homebrew/)
|
||||
or
|
||||
- MacPorts (http://www.macports.org/install.php)
|
||||
|
||||
|
||||
If you're building manually you need Texinfo version 5.0 or later. The
|
||||
simplest way to get it is to use Homebrew (brew install texinfo) and
|
||||
then ``export PATH=/usr/local/opt/texinfo/bin:$PATH``.
|
||||
|
||||
|
||||
With Gentoo Prefix you can build the release version or the latest
|
||||
devel version (-9999) the usual way described in the Gentoo
|
||||
documentation. Alternatively, install the prerequisites and build
|
||||
manually from the sources.
|
||||
|
||||
|
||||
With Homebrew you can either run:
|
||||
brew install [--HEAD] openocd (where optional --HEAD asks brew to
|
||||
install the current git version)
|
||||
or
|
||||
brew install libtool automake libusb [hidapi] [libftdi]
|
||||
(to install the needed dependencies and then proceed with the
|
||||
manual building procedure)
|
||||
|
||||
|
||||
For building with MacPorts you need to run:
|
||||
sudo port install libtool automake autoconf pkgconfig \
|
||||
libusb [libftdi1]
|
||||
|
||||
You should also specify LDFLAGS and CPPFLAGS to allow configure to use
|
||||
MacPorts' libraries, so run configure like this:
|
||||
LDFLAGS=-L/opt/local/lib CPPFLAGS=-I/opt/local/include ./configure [options]
|
||||
|
||||
|
||||
See README for the generic building instructions.
|
||||
|
||||
If you're using a USB adapter and have a driver kext matched to it,
|
||||
you will need to unload it prior to running OpenOCD. E.g. with Apple
|
||||
driver (OS X 10.9 or later) for FTDI run:
|
||||
sudo kextunload -b com.apple.driver.AppleUSBFTDI
|
||||
for FTDI vendor driver use:
|
||||
sudo kextunload FTDIUSBSerialDriver.kext
|
||||
|
||||
To learn more on the topic please refer to the official libusb FAQ:
|
||||
https://github.com/libusb/libusb/wiki/FAQ
|
45
TODO
45
TODO
|
@ -37,33 +37,11 @@ This section provides possible things to improve with OpenOCD's TCL support.
|
|||
- See src/jtag/core.c and src/jtag/tcl.c for an example.
|
||||
- allow some of these TCL command modules to be dynamically loadable?
|
||||
|
||||
@section thelistadapter Adapter
|
||||
@section thelistjtag JTAG
|
||||
|
||||
This section list issues that need to be resolved in the Adapter layer.
|
||||
This section list issues that need to be resolved in the JTAG layer.
|
||||
|
||||
@subsection thelistadapterrework Code restructuring
|
||||
|
||||
This section lists pending reworks to complete the restructure from the
|
||||
old JTAG centric implementation to a generic Adapter layer.
|
||||
This restructuring is very invasive and will prevent the merge of several
|
||||
changes pending in gerrit.
|
||||
|
||||
- rename folder src/jtag/ to src/adapter/
|
||||
- rename var "jtag" to "adapter" in src/jtag/core.c
|
||||
- split content of src/adapter/ in the different protocols jtag.[ch],
|
||||
swd.[ch], ...
|
||||
- wrap the calls to adapter->transport_ops->api() with transport_api()
|
||||
and reduce the visibility of global var "adapter"
|
||||
- complete the migration of JTAG-only drivers to adapter->reset()
|
||||
- try to remove JTAG_SLEEP also from JTAG mode?
|
||||
- tap_set_state(TAP_RESET) is already done in src/jtag/core.c. No need
|
||||
to replicate it in the drivers, apart in case the driver sets TRST
|
||||
independently
|
||||
- add .hla_ops to "adapter"
|
||||
- HLA is a API level (.hla_ops). Transport should simply be {jtag,swd},
|
||||
not {hla_jtag,hla_swd}.
|
||||
|
||||
@subsection thelistadapterjtagcore JTAG Core
|
||||
@subsection thelistjtagcore JTAG Core
|
||||
|
||||
The following tasks have been suggested for cleaning up the JTAG layer:
|
||||
|
||||
|
@ -85,9 +63,9 @@ The following tasks have been suggested for adding new core JTAG support:
|
|||
- (ab)use bit-banging JTAG interfaces to emulate SPI/UART
|
||||
- allow SPI to program flash, MCUs, etc.
|
||||
|
||||
@subsection thelistadapterinterfaces Interface drivers
|
||||
@subsection thelistjtaginterfaces JTAG Interfaces
|
||||
|
||||
There are some known bugs to fix in Interface drivers:
|
||||
There are some known bugs to fix in JTAG adapter drivers:
|
||||
|
||||
- For JTAG_STATEMOVE to TAP_RESET, all drivers must ignore the current
|
||||
recorded state. The tap_get_state() call won't necessarily return
|
||||
|
@ -115,6 +93,9 @@ interface support:
|
|||
-# rewrite implementation to use non-blocking I/O
|
||||
- J-Link driver:
|
||||
- fix to work with long scan chains, such as R.Doss's svf test.
|
||||
- FT2232 (libftdi):
|
||||
- make performance comparable to alternatives (on Win32, D2XX is faster)
|
||||
- make usability comparable to alternatives
|
||||
- Autodetect USB based adapters; this should be easy on Linux. If there's
|
||||
more than one, list the options; otherwise, just select that one.
|
||||
|
||||
|
@ -129,6 +110,10 @@ of a minidriver is required to capture all the jtag_add_xxx()
|
|||
fn's at a high enough level and repackage these cmd's as
|
||||
TCP/IP packets handled by the server.
|
||||
|
||||
@section thelistswd Serial Wire Debug
|
||||
|
||||
- implement Serial Wire Debug interface
|
||||
|
||||
@section thelistbs Boundary Scan Support
|
||||
|
||||
- add STAPL support?
|
||||
|
@ -185,9 +170,9 @@ https://lists.berlios.de/pipermail/openocd-development/2009-October/011506.html
|
|||
garabage.
|
||||
- implement missing functionality (grep FNC_INFO_NOTIMPLEMENTED ...)
|
||||
- Thumb2 single stepping: ARM1156T2 needs simulator support
|
||||
- Cortex-A8 support (ML)
|
||||
- Cortex A8 support (ML)
|
||||
- add target implementation (ML)
|
||||
- Cortex-M3 support
|
||||
- Cortex M3 support
|
||||
- when stepping, only write dirtied registers (be faster)
|
||||
- when connecting to halted core, fetch registers (startup is quirky)
|
||||
- Generic ARM run_algorithm() interface
|
||||
|
@ -383,6 +368,7 @@ to complete:
|
|||
- committing to git
|
||||
- Review Users' Guide for documentation errors or omissions
|
||||
- "capture" and "ocd_find" commands
|
||||
- "ocd_" prefix on various stuff
|
||||
- Update Developer's Manual (doxygen output)
|
||||
- Add documentation describing the architecture of each module
|
||||
- Provide more Technical Primers to bootstrap contributor knowledge
|
||||
|
@ -391,3 +377,4 @@ to complete:
|
|||
/** @file
|
||||
This file contains the @ref thelist page.
|
||||
*/
|
||||
|
||||
|
|
24
bootstrap
24
bootstrap
|
@ -1,6 +1,4 @@
|
|||
#!/bin/sh
|
||||
# SPDX-License-Identifier: GPL-2.0-or-later
|
||||
|
||||
# Run the autotools bootstrap sequence to create the configure script
|
||||
|
||||
# Abort execution on error
|
||||
|
@ -26,14 +24,17 @@ fi
|
|||
# bootstrap the autotools
|
||||
(
|
||||
set -x
|
||||
aclocal --warnings=all
|
||||
# Apparently, not all versions of libtoolize support option --warnings=all .
|
||||
aclocal
|
||||
${libtoolize} --automake --copy
|
||||
autoconf --warnings=all
|
||||
autoheader --warnings=all
|
||||
automake --warnings=all --gnu --add-missing --copy
|
||||
autoconf
|
||||
autoheader
|
||||
automake --gnu --add-missing --copy
|
||||
)
|
||||
|
||||
# AM_MAINTAINER_MODE requires --enable-maintainer-mode from everyone using
|
||||
# current source snapshots (working from GIT, or some source snapshot, etc)
|
||||
# otherwise the documentation will fail to build due to missing version.texi
|
||||
|
||||
if [ -n "$SKIP_SUBMODULE" ]; then
|
||||
echo "Skipping submodule setup"
|
||||
else
|
||||
|
@ -42,12 +43,5 @@ else
|
|||
git submodule update
|
||||
fi
|
||||
|
||||
if [ -x src/jtag/drivers/libjaylink/autogen.sh ]; then
|
||||
(
|
||||
cd src/jtag/drivers/libjaylink
|
||||
./autogen.sh
|
||||
)
|
||||
fi
|
||||
|
||||
echo "Bootstrap complete. Quick build instructions:"
|
||||
echo "./configure ...."
|
||||
echo "./configure --enable-maintainer-mode ...."
|
||||
|
|
|
@ -0,0 +1,12 @@
|
|||
|
||||
# common flags used in openocd build
|
||||
AM_CPPFLAGS = -I$(top_srcdir)/src \
|
||||
-I$(top_builddir)/src \
|
||||
-I$(top_srcdir)/src/helper \
|
||||
-DPKGDATADIR=\"$(pkgdatadir)\" \
|
||||
-DPKGLIBDIR=\"$(pkglibdir)\"
|
||||
|
||||
if INTERNAL_JIMTCL
|
||||
AM_CPPFLAGS += -I$(top_srcdir)/jimtcl \
|
||||
-I$(top_builddir)/jimtcl
|
||||
endif
|
|
@ -1,3 +1,17 @@
|
|||
dnl
|
||||
dnl If needed, define the m4_ifblank and m4_ifnblank macros from autoconf 2.64
|
||||
dnl This allows us to run with earlier Autoconfs as well.
|
||||
ifdef([m4_ifblank],[],[
|
||||
m4_define([m4_ifblank],
|
||||
[m4_if(m4_translit([[$1]], [ ][ ][
|
||||
]), [], [$2], [$3])])])
|
||||
dnl
|
||||
ifdef([m4_ifnblank],[],[
|
||||
m4_define([m4_ifnblank],
|
||||
[m4_if(m4_translit([[$1]], [ ][ ][
|
||||
]), [], [$3], [$2])])])
|
||||
dnl
|
||||
|
||||
dnl AC_CONFIG_SUBDIRS does not allow configure options to be passed
|
||||
dnl to subdirs, this function allows that by creating a configure.gnu
|
||||
dnl script that prepends configure options and then calls the real
|
||||
|
@ -7,6 +21,7 @@ AC_DEFUN([AX_CONFIG_SUBDIR_OPTION],
|
|||
AC_CONFIG_SUBDIRS([$1])
|
||||
|
||||
m4_ifblank([$2], [rm -f $srcdir/$1/configure.gnu],
|
||||
[echo -e '#!/bin/sh\nexec "`dirname "'\$'0"`/configure" '"$2"' "'\$'@"' > "$srcdir/$1/configure.gnu"
|
||||
[printf "#!/bin/sh
|
||||
"\$"SHELL "../$srcdir/$1/configure" $2 \""\$"@"\" > "$srcdir/$1/configure.gnu"
|
||||
])
|
||||
])
|
||||
|
|
1484
configure.ac
1484
configure.ac
File diff suppressed because it is too large
Load Diff
|
@ -1,233 +0,0 @@
|
|||
# Copy this file to /etc/udev/rules.d/
|
||||
# If rules fail to reload automatically, you can refresh udev rules
|
||||
# with the command "udevadm control --reload"
|
||||
|
||||
ACTION!="add|change", GOTO="openocd_rules_end"
|
||||
|
||||
SUBSYSTEM=="gpio", MODE="0660", GROUP="plugdev", TAG+="uaccess"
|
||||
|
||||
SUBSYSTEM!="usb|tty|hidraw", GOTO="openocd_rules_end"
|
||||
|
||||
# Please keep this list sorted by VID:PID
|
||||
|
||||
# opendous and estick
|
||||
ATTRS{idVendor}=="03eb", ATTRS{idProduct}=="204f", MODE="660", GROUP="plugdev", TAG+="uaccess"
|
||||
|
||||
# Original FT232/FT245 VID:PID
|
||||
ATTRS{idVendor}=="0403", ATTRS{idProduct}=="6001", MODE="660", GROUP="plugdev", TAG+="uaccess"
|
||||
|
||||
# Original FT2232 VID:PID
|
||||
ATTRS{idVendor}=="0403", ATTRS{idProduct}=="6010", MODE="660", GROUP="plugdev", TAG+="uaccess"
|
||||
|
||||
# Original FT4232 VID:PID
|
||||
ATTRS{idVendor}=="0403", ATTRS{idProduct}=="6011", MODE="660", GROUP="plugdev", TAG+="uaccess"
|
||||
|
||||
# Original FT232H VID:PID
|
||||
ATTRS{idVendor}=="0403", ATTRS{idProduct}=="6014", MODE="660", GROUP="plugdev", TAG+="uaccess"
|
||||
# Original FT231XQ VID:PID
|
||||
ATTRS{idVendor}=="0403", ATTRS{idProduct}=="6015", MODE="660", GROUP="plugdev", TAG+="uaccess"
|
||||
|
||||
# DISTORTEC JTAG-lock-pick Tiny 2
|
||||
ATTRS{idVendor}=="0403", ATTRS{idProduct}=="8220", MODE="660", GROUP="plugdev", TAG+="uaccess"
|
||||
|
||||
# TUMPA, TUMPA Lite
|
||||
ATTRS{idVendor}=="0403", ATTRS{idProduct}=="8a98", MODE="660", GROUP="plugdev", TAG+="uaccess"
|
||||
ATTRS{idVendor}=="0403", ATTRS{idProduct}=="8a99", MODE="660", GROUP="plugdev", TAG+="uaccess"
|
||||
|
||||
# Marvell OpenRD JTAGKey FT2232D B
|
||||
ATTRS{idVendor}=="0403", ATTRS{idProduct}=="9e90", MODE="660", GROUP="plugdev", TAG+="uaccess"
|
||||
|
||||
# XDS100v2
|
||||
ATTRS{idVendor}=="0403", ATTRS{idProduct}=="a6d0", MODE="660", GROUP="plugdev", TAG+="uaccess"
|
||||
# XDS100v3
|
||||
ATTRS{idVendor}=="0403", ATTRS{idProduct}=="a6d1", MODE="660", GROUP="plugdev", TAG+="uaccess"
|
||||
|
||||
# OOCDLink
|
||||
ATTRS{idVendor}=="0403", ATTRS{idProduct}=="baf8", MODE="660", GROUP="plugdev", TAG+="uaccess"
|
||||
|
||||
# Kristech KT-Link
|
||||
ATTRS{idVendor}=="0403", ATTRS{idProduct}=="bbe2", MODE="660", GROUP="plugdev", TAG+="uaccess"
|
||||
|
||||
# Xverve Signalyzer Tool (DT-USB-ST), Signalyzer LITE (DT-USB-SLITE)
|
||||
ATTRS{idVendor}=="0403", ATTRS{idProduct}=="bca0", MODE="660", GROUP="plugdev", TAG+="uaccess"
|
||||
ATTRS{idVendor}=="0403", ATTRS{idProduct}=="bca1", MODE="660", GROUP="plugdev", TAG+="uaccess"
|
||||
|
||||
# TI/Luminary Stellaris Evaluation Board FTDI (several)
|
||||
ATTRS{idVendor}=="0403", ATTRS{idProduct}=="bcd9", MODE="660", GROUP="plugdev", TAG+="uaccess"
|
||||
|
||||
# TI/Luminary Stellaris In-Circuit Debug Interface FTDI (ICDI) Board
|
||||
ATTRS{idVendor}=="0403", ATTRS{idProduct}=="bcda", MODE="660", GROUP="plugdev", TAG+="uaccess"
|
||||
|
||||
# egnite Turtelizer 2
|
||||
ATTRS{idVendor}=="0403", ATTRS{idProduct}=="bdc8", MODE="660", GROUP="plugdev", TAG+="uaccess"
|
||||
|
||||
# Section5 ICEbear
|
||||
ATTRS{idVendor}=="0403", ATTRS{idProduct}=="c140", MODE="660", GROUP="plugdev", TAG+="uaccess"
|
||||
ATTRS{idVendor}=="0403", ATTRS{idProduct}=="c141", MODE="660", GROUP="plugdev", TAG+="uaccess"
|
||||
|
||||
# Amontec JTAGkey and JTAGkey-tiny
|
||||
ATTRS{idVendor}=="0403", ATTRS{idProduct}=="cff8", MODE="660", GROUP="plugdev", TAG+="uaccess"
|
||||
|
||||
# ASIX Presto programmer
|
||||
ATTRS{idVendor}=="0403", ATTRS{idProduct}=="f1a0", MODE="660", GROUP="plugdev", TAG+="uaccess"
|
||||
|
||||
# Nuvoton NuLink
|
||||
ATTRS{idVendor}=="0416", ATTRS{idProduct}=="511b", MODE="660", GROUP="plugdev", TAG+="uaccess"
|
||||
ATTRS{idVendor}=="0416", ATTRS{idProduct}=="511c", MODE="660", GROUP="plugdev", TAG+="uaccess"
|
||||
ATTRS{idVendor}=="0416", ATTRS{idProduct}=="511d", MODE="660", GROUP="plugdev", TAG+="uaccess"
|
||||
ATTRS{idVendor}=="0416", ATTRS{idProduct}=="5200", MODE="660", GROUP="plugdev", TAG+="uaccess"
|
||||
ATTRS{idVendor}=="0416", ATTRS{idProduct}=="5201", MODE="660", GROUP="plugdev", TAG+="uaccess"
|
||||
|
||||
# TI ICDI
|
||||
ATTRS{idVendor}=="0451", ATTRS{idProduct}=="c32a", MODE="660", GROUP="plugdev", TAG+="uaccess"
|
||||
|
||||
# STMicroelectronics ST-LINK V1
|
||||
ATTRS{idVendor}=="0483", ATTRS{idProduct}=="3744", MODE="660", GROUP="plugdev", TAG+="uaccess"
|
||||
|
||||
# STMicroelectronics ST-LINK/V2
|
||||
ATTRS{idVendor}=="0483", ATTRS{idProduct}=="3748", MODE="660", GROUP="plugdev", TAG+="uaccess"
|
||||
|
||||
# STMicroelectronics ST-LINK/V2.1
|
||||
ATTRS{idVendor}=="0483", ATTRS{idProduct}=="374b", MODE="660", GROUP="plugdev", TAG+="uaccess"
|
||||
ATTRS{idVendor}=="0483", ATTRS{idProduct}=="3752", MODE="660", GROUP="plugdev", TAG+="uaccess"
|
||||
|
||||
# STMicroelectronics STLINK-V3
|
||||
ATTRS{idVendor}=="0483", ATTRS{idProduct}=="374d", MODE="660", GROUP="plugdev", TAG+="uaccess"
|
||||
ATTRS{idVendor}=="0483", ATTRS{idProduct}=="374e", MODE="660", GROUP="plugdev", TAG+="uaccess"
|
||||
ATTRS{idVendor}=="0483", ATTRS{idProduct}=="374f", MODE="660", GROUP="plugdev", TAG+="uaccess"
|
||||
ATTRS{idVendor}=="0483", ATTRS{idProduct}=="3753", MODE="660", GROUP="plugdev", TAG+="uaccess"
|
||||
ATTRS{idVendor}=="0483", ATTRS{idProduct}=="3754", MODE="660", GROUP="plugdev", TAG+="uaccess"
|
||||
|
||||
# Cypress SuperSpeed Explorer Kit
|
||||
ATTRS{idVendor}=="04b4", ATTRS{idProduct}=="0007", MODE="660", GROUP="plugdev", TAG+="uaccess"
|
||||
|
||||
# Cypress KitProg in KitProg mode
|
||||
ATTRS{idVendor}=="04b4", ATTRS{idProduct}=="f139", MODE="660", GROUP="plugdev", TAG+="uaccess"
|
||||
|
||||
# Cypress KitProg in CMSIS-DAP mode
|
||||
ATTRS{idVendor}=="04b4", ATTRS{idProduct}=="f138", MODE="660", GROUP="plugdev", TAG+="uaccess"
|
||||
|
||||
# Infineon DAP miniWiggler v3
|
||||
ATTRS{idVendor}=="058b", ATTRS{idProduct}=="0043", MODE="660", GROUP="plugdev", TAG+="uaccess"
|
||||
|
||||
# Hitex LPC1768-Stick
|
||||
ATTRS{idVendor}=="0640", ATTRS{idProduct}=="0026", MODE="660", GROUP="plugdev", TAG+="uaccess"
|
||||
|
||||
# Hilscher NXHX Boards
|
||||
ATTRS{idVendor}=="0640", ATTRS{idProduct}=="0028", MODE="660", GROUP="plugdev", TAG+="uaccess"
|
||||
|
||||
# Hitex STR9-comStick
|
||||
ATTRS{idVendor}=="0640", ATTRS{idProduct}=="002c", MODE="660", GROUP="plugdev", TAG+="uaccess"
|
||||
|
||||
# Hitex STM32-PerformanceStick
|
||||
ATTRS{idVendor}=="0640", ATTRS{idProduct}=="002d", MODE="660", GROUP="plugdev", TAG+="uaccess"
|
||||
|
||||
# Hitex Cortino
|
||||
ATTRS{idVendor}=="0640", ATTRS{idProduct}=="0032", MODE="660", GROUP="plugdev", TAG+="uaccess"
|
||||
|
||||
# Altera USB Blaster
|
||||
ATTRS{idVendor}=="09fb", ATTRS{idProduct}=="6001", MODE="660", GROUP="plugdev", TAG+="uaccess"
|
||||
# Altera USB Blaster2
|
||||
ATTRS{idVendor}=="09fb", ATTRS{idProduct}=="6010", MODE="660", GROUP="plugdev", TAG+="uaccess"
|
||||
ATTRS{idVendor}=="09fb", ATTRS{idProduct}=="6810", MODE="660", GROUP="plugdev", TAG+="uaccess"
|
||||
|
||||
# Ashling Opella-LD
|
||||
ATTRS{idVendor}=="0B6B", ATTRS{idProduct}=="0040", MODE="660", GROUP="plugdev", TAG+="uaccess"
|
||||
|
||||
# Amontec JTAGkey-HiSpeed
|
||||
ATTRS{idVendor}=="0fbb", ATTRS{idProduct}=="1000", MODE="660", GROUP="plugdev", TAG+="uaccess"
|
||||
|
||||
# SEGGER J-Link
|
||||
ATTRS{idVendor}=="1366", ATTRS{idProduct}=="0101", MODE="660", GROUP="plugdev", TAG+="uaccess"
|
||||
ATTRS{idVendor}=="1366", ATTRS{idProduct}=="0102", MODE="660", GROUP="plugdev", TAG+="uaccess"
|
||||
ATTRS{idVendor}=="1366", ATTRS{idProduct}=="0103", MODE="660", GROUP="plugdev", TAG+="uaccess"
|
||||
ATTRS{idVendor}=="1366", ATTRS{idProduct}=="0104", MODE="660", GROUP="plugdev", TAG+="uaccess"
|
||||
ATTRS{idVendor}=="1366", ATTRS{idProduct}=="0105", MODE="660", GROUP="plugdev", TAG+="uaccess"
|
||||
ATTRS{idVendor}=="1366", ATTRS{idProduct}=="0107", MODE="660", GROUP="plugdev", TAG+="uaccess"
|
||||
ATTRS{idVendor}=="1366", ATTRS{idProduct}=="0108", MODE="660", GROUP="plugdev", TAG+="uaccess"
|
||||
ATTRS{idVendor}=="1366", ATTRS{idProduct}=="1010", MODE="660", GROUP="plugdev", TAG+="uaccess"
|
||||
ATTRS{idVendor}=="1366", ATTRS{idProduct}=="1011", MODE="660", GROUP="plugdev", TAG+="uaccess"
|
||||
ATTRS{idVendor}=="1366", ATTRS{idProduct}=="1012", MODE="660", GROUP="plugdev", TAG+="uaccess"
|
||||
ATTRS{idVendor}=="1366", ATTRS{idProduct}=="1013", MODE="660", GROUP="plugdev", TAG+="uaccess"
|
||||
ATTRS{idVendor}=="1366", ATTRS{idProduct}=="1014", MODE="660", GROUP="plugdev", TAG+="uaccess"
|
||||
ATTRS{idVendor}=="1366", ATTRS{idProduct}=="1015", MODE="660", GROUP="plugdev", TAG+="uaccess"
|
||||
ATTRS{idVendor}=="1366", ATTRS{idProduct}=="1016", MODE="660", GROUP="plugdev", TAG+="uaccess"
|
||||
ATTRS{idVendor}=="1366", ATTRS{idProduct}=="1017", MODE="660", GROUP="plugdev", TAG+="uaccess"
|
||||
ATTRS{idVendor}=="1366", ATTRS{idProduct}=="1018", MODE="660", GROUP="plugdev", TAG+="uaccess"
|
||||
ATTRS{idVendor}=="1366", ATTRS{idProduct}=="1020", MODE="660", GROUP="plugdev", TAG+="uaccess"
|
||||
ATTRS{idVendor}=="1366", ATTRS{idProduct}=="1051", MODE="660", GROUP="plugdev", TAG+="uaccess"
|
||||
ATTRS{idVendor}=="1366", ATTRS{idProduct}=="1055", MODE="660", GROUP="plugdev", TAG+="uaccess"
|
||||
ATTRS{idVendor}=="1366", ATTRS{idProduct}=="1061", MODE="660", GROUP="plugdev", TAG+="uaccess"
|
||||
|
||||
# Raisonance RLink
|
||||
ATTRS{idVendor}=="138e", ATTRS{idProduct}=="9000", MODE="660", GROUP="plugdev", TAG+="uaccess"
|
||||
|
||||
# Debug Board for Neo1973
|
||||
ATTRS{idVendor}=="1457", ATTRS{idProduct}=="5118", MODE="660", GROUP="plugdev", TAG+="uaccess"
|
||||
|
||||
# OSBDM
|
||||
ATTRS{idVendor}=="15a2", ATTRS{idProduct}=="0042", MODE="660", GROUP="plugdev", TAG+="uaccess"
|
||||
ATTRS{idVendor}=="15a2", ATTRS{idProduct}=="0058", MODE="660", GROUP="plugdev", TAG+="uaccess"
|
||||
ATTRS{idVendor}=="15a2", ATTRS{idProduct}=="005e", MODE="660", GROUP="plugdev", TAG+="uaccess"
|
||||
|
||||
# Olimex ARM-USB-OCD
|
||||
ATTRS{idVendor}=="15ba", ATTRS{idProduct}=="0003", MODE="660", GROUP="plugdev", TAG+="uaccess"
|
||||
|
||||
# Olimex ARM-USB-OCD-TINY
|
||||
ATTRS{idVendor}=="15ba", ATTRS{idProduct}=="0004", MODE="660", GROUP="plugdev", TAG+="uaccess"
|
||||
|
||||
# Olimex ARM-JTAG-EW
|
||||
ATTRS{idVendor}=="15ba", ATTRS{idProduct}=="001e", MODE="660", GROUP="plugdev", TAG+="uaccess"
|
||||
|
||||
# Olimex ARM-USB-OCD-TINY-H
|
||||
ATTRS{idVendor}=="15ba", ATTRS{idProduct}=="002a", MODE="660", GROUP="plugdev", TAG+="uaccess"
|
||||
|
||||
# Olimex ARM-USB-OCD-H
|
||||
ATTRS{idVendor}=="15ba", ATTRS{idProduct}=="002b", MODE="660", GROUP="plugdev", TAG+="uaccess"
|
||||
|
||||
# ixo-usb-jtag - Emulation of a Altera Bus Blaster I on a Cypress FX2 IC
|
||||
ATTRS{idVendor}=="16c0", ATTRS{idProduct}=="06ad", MODE="660", GROUP="plugdev", TAG+="uaccess"
|
||||
|
||||
# USBprog with OpenOCD firmware
|
||||
ATTRS{idVendor}=="1781", ATTRS{idProduct}=="0c63", MODE="660", GROUP="plugdev", TAG+="uaccess"
|
||||
|
||||
# TI/Luminary Stellaris In-Circuit Debug Interface (ICDI) Board
|
||||
ATTRS{idVendor}=="1cbe", ATTRS{idProduct}=="00fd", MODE="660", GROUP="plugdev", TAG+="uaccess"
|
||||
|
||||
# TI XDS110 Debug Probe (Launchpads and Standalone)
|
||||
ATTRS{idVendor}=="0451", ATTRS{idProduct}=="bef3", MODE="660", GROUP="plugdev", TAG+="uaccess"
|
||||
ATTRS{idVendor}=="0451", ATTRS{idProduct}=="bef4", MODE="660", GROUP="plugdev", TAG+="uaccess"
|
||||
ATTRS{idVendor}=="1cbe", ATTRS{idProduct}=="02a5", MODE="660", GROUP="plugdev", TAG+="uaccess"
|
||||
|
||||
# TI Tiva-based ICDI and XDS110 probes in DFU mode
|
||||
ATTRS{idVendor}=="1cbe", ATTRS{idProduct}=="00ff", MODE="660", GROUP="plugdev", TAG+="uaccess"
|
||||
|
||||
# isodebug v1
|
||||
ATTRS{idVendor}=="22b7", ATTRS{idProduct}=="150d", MODE="660", GROUP="plugdev", TAG+="uaccess"
|
||||
|
||||
# PLS USB/JTAG Adapter for SPC5xxx
|
||||
ATTRS{idVendor}=="263d", ATTRS{idProduct}=="4001", MODE="660", GROUP="plugdev", TAG+="uaccess"
|
||||
|
||||
# Numato Mimas A7 - Artix 7 FPGA Board
|
||||
ATTRS{idVendor}=="2a19", ATTRS{idProduct}=="1009", MODE="660", GROUP="plugdev", TAG+="uaccess"
|
||||
|
||||
# Ambiq Micro EVK and Debug boards.
|
||||
ATTRS{idVendor}=="2aec", ATTRS{idProduct}=="6010", MODE="660", GROUP="plugdev", TAG+="uaccess"
|
||||
ATTRS{idVendor}=="2aec", ATTRS{idProduct}=="6011", MODE="660", GROUP="plugdev", TAG+="uaccess"
|
||||
ATTRS{idVendor}=="2aec", ATTRS{idProduct}=="1106", MODE="660", GROUP="plugdev", TAG+="uaccess"
|
||||
|
||||
# Espressif USB JTAG/serial debug units
|
||||
ATTRS{idVendor}=="303a", ATTRS{idProduct}=="1001", MODE="660", GROUP="plugdev", TAG+="uaccess"
|
||||
ATTRS{idVendor}=="303a", ATTRS{idProduct}=="1002", MODE="660", GROUP="plugdev", TAG+="uaccess"
|
||||
|
||||
# Marvell Sheevaplug
|
||||
ATTRS{idVendor}=="9e88", ATTRS{idProduct}=="9e8f", MODE="660", GROUP="plugdev", TAG+="uaccess"
|
||||
|
||||
# Keil Software, Inc. ULink
|
||||
ATTRS{idVendor}=="c251", ATTRS{idProduct}=="2710", MODE="660", GROUP="plugdev", TAG+="uaccess"
|
||||
ATTRS{idVendor}=="c251", ATTRS{idProduct}=="2750", MODE="660", GROUP="plugdev", TAG+="uaccess"
|
||||
|
||||
# CMSIS-DAP compatible adapters
|
||||
ATTRS{product}=="*CMSIS-DAP*", MODE="660", GROUP="plugdev", TAG+="uaccess"
|
||||
|
||||
LABEL="openocd_rules_end"
|
|
@ -1,27 +0,0 @@
|
|||
BR2_armeb=y
|
||||
BR2_cortex_a7=y
|
||||
BR2_TOOLCHAIN_EXTERNAL=y
|
||||
BR2_PACKAGE_OPENOCD=y
|
||||
BR2_PACKAGE_OPENOCD_FTDI=y
|
||||
BR2_PACKAGE_OPENOCD_STLINK=y
|
||||
BR2_PACKAGE_OPENOCD_TI_ICDI=y
|
||||
BR2_PACKAGE_OPENOCD_ULINK=y
|
||||
BR2_PACKAGE_OPENOCD_UBLASTER2=y
|
||||
BR2_PACKAGE_OPENOCD_JLINK=y
|
||||
BR2_PACKAGE_OPENOCD_OSDBM=y
|
||||
BR2_PACKAGE_OPENOCD_OPENDOUS=y
|
||||
BR2_PACKAGE_OPENOCD_AICE=y
|
||||
BR2_PACKAGE_OPENOCD_VSLLINK=y
|
||||
BR2_PACKAGE_OPENOCD_USBPROG=y
|
||||
BR2_PACKAGE_OPENOCD_RLINK=y
|
||||
BR2_PACKAGE_OPENOCD_ARMEW=y
|
||||
BR2_PACKAGE_OPENOCD_XDS110=y
|
||||
BR2_PACKAGE_OPENOCD_PARPORT=y
|
||||
BR2_PACKAGE_OPENOCD_VPI=y
|
||||
BR2_PACKAGE_OPENOCD_UBLASTER=y
|
||||
BR2_PACKAGE_OPENOCD_AMTJT=y
|
||||
BR2_PACKAGE_OPENOCD_GW16012=y
|
||||
BR2_PACKAGE_OPENOCD_PRESTO=y
|
||||
BR2_PACKAGE_OPENOCD_OPENJTAG=y
|
||||
BR2_PACKAGE_OPENOCD_BUSPIRATE=y
|
||||
BR2_PACKAGE_OPENOCD_SYSFS=y
|
|
@ -62,7 +62,7 @@ Clearly some of that data would be valuable for interactive debugging.
|
|||
+In any case, OpenOCD is not currently GUI-oriented. Accordingly, we now
|
||||
+expect any such graphics to come from postprocessing.
|
||||
|
||||
measurements for RTOS event timings should also be easy to collect.
|
||||
measurments for RTOS event timings should also be easy to collect.
|
||||
+Examples include context and message switch times, as well as times
|
||||
for application interactions.
|
||||
+
|
||||
|
|
|
@ -1,173 +0,0 @@
|
|||
#!/bin/sh
|
||||
|
||||
# This is an example of how to do a cross-build of OpenOCD using pkg-config.
|
||||
# Cross-building with pkg-config is deceptively hard and most guides and
|
||||
# tutorials are incomplete or give bad advice. Some of the traps that are easy
|
||||
# to fall in but handled by this script are:
|
||||
#
|
||||
# * Polluting search paths and flags with values from the build system.
|
||||
# * Faulty pkg-config wrappers shipped with distribution packaged cross-
|
||||
# toolchains.
|
||||
# * Build failing because pkg-config discards some paths even though they are
|
||||
# correctly listed in the .pc file.
|
||||
# * Getting successfully built binaries that cannot find runtime data because
|
||||
# paths refer to the build file system.
|
||||
#
|
||||
# This script is probably more useful as a reference than as a complete build
|
||||
# tool but for some configurations it may be usable as-is. It only cross-builds
|
||||
# libusb-1.0, hidapi, libftdi and capstone from source, but the script can be
|
||||
# extended to build other prerequisites in a similar manner.
|
||||
#
|
||||
# Usage:
|
||||
# export LIBUSB1_SRC=/path/to/libusb-1.0
|
||||
# export HIDAPI_SRC=/path/to/hidapi
|
||||
# export OPENOCD_CONFIG="--enable-..."
|
||||
# cd /work/dir
|
||||
# /path/to/openocd/contrib/cross-build.sh <host-triplet>
|
||||
#
|
||||
# For static linking, a workaround is to
|
||||
# export LIBUSB1_CONFIG="--enable-static --disable-shared"
|
||||
#
|
||||
# All the paths must not contain any spaces.
|
||||
|
||||
set -e -x
|
||||
|
||||
WORK_DIR=$PWD
|
||||
|
||||
## Source code paths, customize as necessary
|
||||
: ${OPENOCD_SRC:="`dirname "$0"`/.."}
|
||||
: ${LIBUSB1_SRC:=/path/to/libusb1}
|
||||
: ${HIDAPI_SRC:=/path/to/hidapi}
|
||||
: ${LIBFTDI_SRC:=/path/to/libftdi}
|
||||
: ${CAPSTONE_SRC:=/path/to/capstone}
|
||||
|
||||
OPENOCD_SRC=`readlink -m $OPENOCD_SRC`
|
||||
LIBUSB1_SRC=`readlink -m $LIBUSB1_SRC`
|
||||
HIDAPI_SRC=`readlink -m $HIDAPI_SRC`
|
||||
LIBFTDI_SRC=`readlink -m $LIBFTDI_SRC`
|
||||
CAPSTONE_SRC=`readlink -m $CAPSTONE_SRC`
|
||||
|
||||
HOST_TRIPLET=$1
|
||||
BUILD_DIR=$WORK_DIR/$HOST_TRIPLET-build
|
||||
LIBUSB1_BUILD_DIR=$BUILD_DIR/libusb1
|
||||
HIDAPI_BUILD_DIR=$BUILD_DIR/hidapi
|
||||
LIBFTDI_BUILD_DIR=$BUILD_DIR/libftdi
|
||||
CAPSTONE_BUILD_DIR=$BUILD_DIR/capstone
|
||||
OPENOCD_BUILD_DIR=$BUILD_DIR/openocd
|
||||
|
||||
## Root of host file tree
|
||||
SYSROOT=$WORK_DIR/$HOST_TRIPLET-root
|
||||
|
||||
## Install location within host file tree
|
||||
: ${PREFIX=/usr}
|
||||
|
||||
## Make parallel jobs
|
||||
: ${MAKE_JOBS:=1}
|
||||
|
||||
## OpenOCD-only install dir for packaging
|
||||
: ${OPENOCD_TAG:=`git --git-dir=$OPENOCD_SRC/.git describe --tags`}
|
||||
PACKAGE_DIR=$WORK_DIR/openocd_${OPENOCD_TAG}_${HOST_TRIPLET}
|
||||
|
||||
#######
|
||||
|
||||
# Create pkg-config wrapper and make sure it's used
|
||||
export PKG_CONFIG=$WORK_DIR/$HOST_TRIPLET-pkg-config
|
||||
|
||||
cat > $PKG_CONFIG <<EOF
|
||||
#!/bin/sh
|
||||
|
||||
SYSROOT=$SYSROOT
|
||||
|
||||
export PKG_CONFIG_DIR=
|
||||
export PKG_CONFIG_LIBDIR=\${SYSROOT}$PREFIX/lib/pkgconfig:\${SYSROOT}$PREFIX/share/pkgconfig
|
||||
export PKG_CONFIG_SYSROOT_DIR=\${SYSROOT}
|
||||
|
||||
# The following have to be set to avoid pkg-config to strip /usr/include and /usr/lib from paths
|
||||
# before they are prepended with the sysroot path. Feels like a pkg-config bug.
|
||||
export PKG_CONFIG_ALLOW_SYSTEM_CFLAGS=
|
||||
export PKG_CONFIG_ALLOW_SYSTEM_LIBS=
|
||||
|
||||
exec pkg-config "\$@"
|
||||
EOF
|
||||
chmod +x $PKG_CONFIG
|
||||
|
||||
# Clear out work dir
|
||||
rm -rf $SYSROOT $BUILD_DIR
|
||||
mkdir -p $SYSROOT
|
||||
|
||||
# libusb-1.0 build & install into sysroot
|
||||
if [ -d $LIBUSB1_SRC ] ; then
|
||||
mkdir -p $LIBUSB1_BUILD_DIR
|
||||
cd $LIBUSB1_BUILD_DIR
|
||||
$LIBUSB1_SRC/configure --build=`$LIBUSB1_SRC/config.guess` --host=$HOST_TRIPLET \
|
||||
--with-sysroot=$SYSROOT --prefix=$PREFIX \
|
||||
$LIBUSB1_CONFIG
|
||||
make -j $MAKE_JOBS
|
||||
make install DESTDIR=$SYSROOT
|
||||
fi
|
||||
|
||||
# hidapi build & install into sysroot
|
||||
if [ -d $HIDAPI_SRC ] ; then
|
||||
mkdir -p $HIDAPI_BUILD_DIR
|
||||
cd $HIDAPI_BUILD_DIR
|
||||
$HIDAPI_SRC/configure --build=`$HIDAPI_SRC/config.guess` --host=$HOST_TRIPLET \
|
||||
--with-sysroot=$SYSROOT --prefix=$PREFIX \
|
||||
$HIDAPI_CONFIG
|
||||
make -j $MAKE_JOBS
|
||||
make install DESTDIR=$SYSROOT
|
||||
fi
|
||||
|
||||
# libftdi build & install into sysroot
|
||||
if [ -d $LIBFTDI_SRC ] ; then
|
||||
mkdir -p $LIBFTDI_BUILD_DIR
|
||||
cd $LIBFTDI_BUILD_DIR
|
||||
# note : libftdi versions < 1.5 requires libusb1 static
|
||||
# hint use : # export LIBUSB1_CONFIG="--enable-static ..."
|
||||
# not needed since libftdi-1.5 when LIBFTDI_CONFIG="-DSTATICLIBS=OFF ..."
|
||||
|
||||
# fix <toolchain>.cmake file
|
||||
ESCAPED_SYSROOT=$(printf '%s\n' "$SYSROOT" | sed -e 's/[\/&]/\\&/g')
|
||||
sed -i -E "s/(SET\(CMAKE_FIND_ROOT_PATH\s+).+\)/\1${ESCAPED_SYSROOT})/" \
|
||||
${LIBFTDI_SRC}/cmake/Toolchain-${HOST_TRIPLET}.cmake
|
||||
|
||||
cmake $LIBFTDI_CONFIG \
|
||||
-DCMAKE_TOOLCHAIN_FILE=${LIBFTDI_SRC}/cmake/Toolchain-${HOST_TRIPLET}.cmake \
|
||||
-DCMAKE_INSTALL_PREFIX=${PREFIX} \
|
||||
-DPKG_CONFIG_EXECUTABLE=`which pkg-config` \
|
||||
$LIBFTDI_SRC
|
||||
make install DESTDIR=$SYSROOT
|
||||
fi
|
||||
|
||||
# capstone build & install into sysroot
|
||||
if [ -d $CAPSTONE_SRC ] ; then
|
||||
mkdir -p $CAPSTONE_BUILD_DIR
|
||||
cd $CAPSTONE_BUILD_DIR
|
||||
cp -r $CAPSTONE_SRC/* .
|
||||
make install DESTDIR=$SYSROOT PREFIX=$PREFIX \
|
||||
CROSS="${HOST_TRIPLET}-" \
|
||||
$CAPSTONE_CONFIG
|
||||
# fix the generated capstone.pc
|
||||
CAPSTONE_PC_FILE=${SYSROOT}${PREFIX}/lib/pkgconfig/capstone.pc
|
||||
sed -i '/^libdir=/d' $CAPSTONE_PC_FILE
|
||||
sed -i '/^includedir=/d' $CAPSTONE_PC_FILE
|
||||
sed -i '/^archive=/d' $CAPSTONE_PC_FILE
|
||||
sed -i '1s;^;prefix=/usr \
|
||||
exec_prefix=${prefix} \
|
||||
libdir=${exec_prefix}/lib \
|
||||
includedir=${prefix}/include/capstone\n\n;' $CAPSTONE_PC_FILE
|
||||
fi
|
||||
|
||||
|
||||
# OpenOCD build & install into sysroot
|
||||
mkdir -p $OPENOCD_BUILD_DIR
|
||||
cd $OPENOCD_BUILD_DIR
|
||||
$OPENOCD_SRC/configure --build=`$OPENOCD_SRC/config.guess` --host=$HOST_TRIPLET \
|
||||
--with-sysroot=$SYSROOT --prefix=$PREFIX \
|
||||
$OPENOCD_CONFIG
|
||||
make -j $MAKE_JOBS
|
||||
make install-strip DESTDIR=$SYSROOT
|
||||
|
||||
# Separate OpenOCD install w/o dependencies. OpenOCD will have to be linked
|
||||
# statically or have dependencies packaged/installed separately.
|
||||
make install-strip DESTDIR=$PACKAGE_DIR
|
||||
|
|
@ -6,7 +6,7 @@
|
|||
$comment = "// Autogenerated by contrib/gen-stellaris-part-header.pl
|
||||
// From Stellaris Firmware Development Package revision";
|
||||
|
||||
$struct_header = "static const struct {
|
||||
$struct_header = "static struct {
|
||||
uint8_t class;
|
||||
uint8_t partno;
|
||||
const char *partname;
|
||||
|
|
|
@ -39,13 +39,11 @@
|
|||
|
||||
#include <errno.h>
|
||||
#include <libgen.h>
|
||||
#include <stdbool.h>
|
||||
#include <stdio.h>
|
||||
#include <stdlib.h>
|
||||
#include <stdbool.h>
|
||||
#include <string.h>
|
||||
#include <unistd.h>
|
||||
|
||||
unsigned int dump_swit;
|
||||
|
||||
/* Example ITM trace word (0xWWXXYYZZ) parsing for task events, sent
|
||||
* on port 31 (Reserved for "the" RTOS in CMSIS v1.30)
|
||||
|
@ -61,9 +59,6 @@ static void show_task(int port, unsigned data)
|
|||
unsigned code = data >> 16;
|
||||
char buf[16];
|
||||
|
||||
if (dump_swit)
|
||||
return;
|
||||
|
||||
switch (code) {
|
||||
case 0:
|
||||
strcpy(buf, "run");
|
||||
|
@ -92,9 +87,6 @@ static void show_reserved(FILE *f, char *label, int c)
|
|||
{
|
||||
unsigned i;
|
||||
|
||||
if (dump_swit)
|
||||
return;
|
||||
|
||||
printf("%s - %#02x", label, c);
|
||||
|
||||
for (i = 0; (c & 0x80) && i < 4; i++) {
|
||||
|
@ -113,6 +105,7 @@ static bool read_varlen(FILE *f, int c, unsigned *value)
|
|||
{
|
||||
unsigned size;
|
||||
unsigned char buf[4];
|
||||
unsigned i;
|
||||
|
||||
*value = 0;
|
||||
|
||||
|
@ -137,25 +130,23 @@ static bool read_varlen(FILE *f, int c, unsigned *value)
|
|||
|
||||
*value = (buf[3] << 24)
|
||||
+ (buf[2] << 16)
|
||||
+ (buf[1] << 8)
|
||||
+ (buf[2] << 8)
|
||||
+ (buf[0] << 0);
|
||||
return true;
|
||||
|
||||
err:
|
||||
printf("(ERROR %d - %s)\n", errno, strerror(errno));
|
||||
return false;
|
||||
return;
|
||||
}
|
||||
|
||||
static void show_hard(FILE *f, int c)
|
||||
{
|
||||
unsigned type = c >> 3;
|
||||
unsigned value;
|
||||
unsigned size;
|
||||
char *label;
|
||||
|
||||
if (dump_swit)
|
||||
return;
|
||||
|
||||
printf("DWT - ");
|
||||
printf("DWT - ", type);
|
||||
|
||||
if (!read_varlen(f, c, &value))
|
||||
return;
|
||||
|
@ -225,7 +216,7 @@ static void show_hard(FILE *f, int c)
|
|||
}
|
||||
break;
|
||||
default:
|
||||
printf("UNDEFINED, rawtype: %x", type);
|
||||
printf("UNDEFINED");
|
||||
break;
|
||||
}
|
||||
|
||||
|
@ -250,28 +241,19 @@ struct {
|
|||
|
||||
static void show_swit(FILE *f, int c)
|
||||
{
|
||||
unsigned size;
|
||||
unsigned port = c >> 3;
|
||||
unsigned char buf[4];
|
||||
unsigned value = 0;
|
||||
unsigned i;
|
||||
|
||||
if (port + 1 == dump_swit) {
|
||||
if (!read_varlen(f, c, &value))
|
||||
return;
|
||||
printf("%c", value);
|
||||
return;
|
||||
}
|
||||
printf("SWIT %u - ", port);
|
||||
|
||||
if (!read_varlen(f, c, &value))
|
||||
return;
|
||||
|
||||
if (dump_swit)
|
||||
return;
|
||||
|
||||
printf("SWIT %u - ", port);
|
||||
|
||||
printf("%#08x", value);
|
||||
|
||||
for (i = 0; i < sizeof(format) / sizeof(format[0]); i++) {
|
||||
for (i = 0; i <= sizeof(format) / sizeof(format[0]); i++) {
|
||||
if (format[i].port == port) {
|
||||
printf(", ");
|
||||
format[i].show(port, value);
|
||||
|
@ -281,6 +263,10 @@ static void show_swit(FILE *f, int c)
|
|||
|
||||
printf("\n");
|
||||
return;
|
||||
|
||||
err:
|
||||
printf("(ERROR %d - %s)\n", errno, strerror(errno));
|
||||
return;
|
||||
}
|
||||
|
||||
static void show_timestamp(FILE *f, int c)
|
||||
|
@ -289,9 +275,6 @@ static void show_timestamp(FILE *f, int c)
|
|||
char *label = "";
|
||||
bool delayed = false;
|
||||
|
||||
if (dump_swit)
|
||||
return;
|
||||
|
||||
printf("TIMESTAMP - ");
|
||||
|
||||
/* Format 2: header only */
|
||||
|
@ -310,7 +293,7 @@ static void show_timestamp(FILE *f, int c)
|
|||
}
|
||||
|
||||
/* Format 1: one to four bytes of data too */
|
||||
switch (c >> 4) {
|
||||
switch (c) {
|
||||
default:
|
||||
label = ", reserved control\n";
|
||||
break;
|
||||
|
@ -326,7 +309,7 @@ static void show_timestamp(FILE *f, int c)
|
|||
delayed = true;
|
||||
break;
|
||||
case 0xf:
|
||||
label = ", packet and timestamp delayed";
|
||||
label = ", packet and timetamp delayed";
|
||||
delayed = true;
|
||||
break;
|
||||
}
|
||||
|
@ -373,7 +356,7 @@ int main(int argc, char **argv)
|
|||
int c;
|
||||
|
||||
/* parse arguments */
|
||||
while ((c = getopt(argc, argv, "f:d:")) != EOF) {
|
||||
while ((c = getopt(argc, argv, "f:")) != EOF) {
|
||||
switch (c) {
|
||||
case 'f':
|
||||
/* e.g. from UART connected to /dev/ttyUSB0 */
|
||||
|
@ -383,10 +366,8 @@ int main(int argc, char **argv)
|
|||
return 1;
|
||||
}
|
||||
break;
|
||||
case 'd':
|
||||
dump_swit = atoi(optarg);
|
||||
break;
|
||||
default:
|
||||
usage:
|
||||
fprintf(stderr, "usage: %s [-f input]",
|
||||
basename(argv[0]));
|
||||
return 1;
|
||||
|
|
|
@ -16,3 +16,4 @@ To see how many times the trace point was hit:
|
|||
|
||||
Spen
|
||||
spen@spen-soft.co.uk
|
||||
|
||||
|
|
|
@ -17,7 +17,9 @@
|
|||
* 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, see <http://www.gnu.org/licenses/>. *
|
||||
* along with this program; if not, write to the *
|
||||
* Free Software Foundation, Inc., *
|
||||
* 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. *
|
||||
***************************************************************************/
|
||||
|
||||
#include "dcc_stdio.h"
|
||||
|
|
|
@ -15,7 +15,9 @@
|
|||
* 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, see <http://www.gnu.org/licenses/>. *
|
||||
* along with this program; if not, write to the *
|
||||
* Free Software Foundation, Inc., *
|
||||
* 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. *
|
||||
***************************************************************************/
|
||||
|
||||
#ifndef DCC_STDIO_H
|
||||
|
|
|
@ -15,7 +15,9 @@
|
|||
* 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, see <http://www.gnu.org/licenses/>. *
|
||||
* along with this program; if not, write to the *
|
||||
* Free Software Foundation, Inc., *
|
||||
* 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. *
|
||||
***************************************************************************/
|
||||
|
||||
#include "dcc_stdio.h"
|
||||
|
|
|
@ -1,74 +0,0 @@
|
|||
/* SPDX-License-Identifier: GPL-2.0-or-later */
|
||||
/* Copyright (C) 2021 by Andreas Fritiofson <andreas.fritiofson@gmail.com> */
|
||||
|
||||
/*
|
||||
* Simple example of using a circular doubly linked list through list.h
|
||||
*
|
||||
* gcc -I ../src/ list_example.c -o list_example
|
||||
*/
|
||||
|
||||
#include <stdint.h>
|
||||
#include <stdbool.h>
|
||||
#include <assert.h>
|
||||
#include <helper/list.h>
|
||||
|
||||
static LIST_HEAD(threads);
|
||||
|
||||
struct thread {
|
||||
int id;
|
||||
uint64_t tcb_address;
|
||||
struct list_head lh;
|
||||
};
|
||||
|
||||
void insert(struct thread *t)
|
||||
{
|
||||
list_add_tail(&t->lh, &threads);
|
||||
}
|
||||
|
||||
void remove(struct thread *t)
|
||||
{
|
||||
list_del(&t->lh);
|
||||
}
|
||||
|
||||
struct thread *lookup_id(int id)
|
||||
{
|
||||
struct thread *t;
|
||||
list_for_each_entry(t, &threads, lh) {
|
||||
if (t->id == id)
|
||||
return t;
|
||||
}
|
||||
return NULL;
|
||||
}
|
||||
|
||||
struct thread *lookup_tcb(uint64_t addr)
|
||||
{
|
||||
struct thread *t;
|
||||
list_for_each_entry(t, &threads, lh) {
|
||||
if (t->tcb_address == addr)
|
||||
return t;
|
||||
}
|
||||
return NULL;
|
||||
}
|
||||
|
||||
int main(void)
|
||||
{
|
||||
struct thread t1 = { .id = 1, .tcb_address = 111111111 };
|
||||
struct thread t2 = { .id = 2, .tcb_address = 222222222 };
|
||||
struct thread t3 = { .id = 3, .tcb_address = 333333333 };
|
||||
|
||||
insert(&t1);
|
||||
insert(&t2);
|
||||
assert(lookup_id(1) == &t1);
|
||||
assert(lookup_tcb(111111111) == &t1);
|
||||
assert(lookup_id(2) == &t2);
|
||||
assert(lookup_id(42) == NULL);
|
||||
remove(&t1);
|
||||
assert(lookup_id(1) == NULL);
|
||||
insert(&t3);
|
||||
remove(&t2);
|
||||
assert(lookup_id(3) == &t3);
|
||||
assert(lookup_tcb(333333333) == &t3);
|
||||
assert(lookup_id(2) == NULL);
|
||||
remove(&t3);
|
||||
assert(list_empty(&threads));
|
||||
}
|
|
@ -1,38 +0,0 @@
|
|||
.PHONY: arm clean-arm
|
||||
|
||||
all: arm stm8
|
||||
|
||||
common_dirs = \
|
||||
checksum \
|
||||
erase_check \
|
||||
watchdog
|
||||
|
||||
ARM_CROSS_COMPILE ?= arm-none-eabi-
|
||||
|
||||
arm_dirs = \
|
||||
flash/fm4 \
|
||||
flash/kinetis_ke \
|
||||
flash/max32xxx \
|
||||
flash/xmc1xxx \
|
||||
debug/xscale
|
||||
|
||||
arm:
|
||||
for d in $(common_dirs); do \
|
||||
$(MAKE) -C $$d arm; \
|
||||
done
|
||||
for d in $(arm_dirs); do \
|
||||
$(MAKE) -C $$d all CROSS_COMPILE=$(ARM_CROSS_COMPILE); \
|
||||
done
|
||||
|
||||
clean-arm:
|
||||
for d in $(arm_dirs); do \
|
||||
$(MAKE) -C $$d clean; \
|
||||
done
|
||||
|
||||
clean: clean-arm
|
||||
for d in $(common_dirs); do \
|
||||
$(MAKE) -C $$d clean; \
|
||||
done
|
||||
|
||||
stm8:
|
||||
$(MAKE) -C erase_check stm8
|
|
@ -7,7 +7,7 @@ checksum/armv4_5_crc.s :
|
|||
- ARMv4 and ARMv5 checksum loader : see target/arm_crc_code.c:arm_crc_code
|
||||
|
||||
checksum/armv7m_crc.s :
|
||||
- ARMv7m checksum loader : see target/armv7m.c:cortex_m_crc_code
|
||||
- ARMv7m checksum loader : see target/armv7m.c:cortex_m3_crc_code
|
||||
|
||||
checksum/mips32.s :
|
||||
- MIPS32 checksum loader : see target/mips32.c:mips_crc_code
|
||||
|
|
|
@ -1,46 +0,0 @@
|
|||
BIN2C = ../../../src/helper/bin2char.sh
|
||||
|
||||
ARM_CROSS_COMPILE ?= arm-none-eabi-
|
||||
ARM_AS ?= $(ARM_CROSS_COMPILE)as
|
||||
ARM_OBJCOPY ?= $(ARM_CROSS_COMPILE)objcopy
|
||||
|
||||
ARM_AFLAGS = -EL
|
||||
|
||||
RISCV_CROSS_COMPILE ?= riscv64-unknown-elf-
|
||||
RISCV_CC ?= $(RISCV_CROSS_COMPILE)gcc
|
||||
RISCV_OBJCOPY ?= $(RISCV_CROSS_COMPILE)objcopy
|
||||
RISCV32_CFLAGS = -march=rv32e -mabi=ilp32e -nostdlib -nostartfiles -Os -fPIC
|
||||
RISCV64_CFLAGS = -march=rv64i -mabi=lp64 -nostdlib -nostartfiles -Os -fPIC
|
||||
|
||||
all: arm riscv
|
||||
|
||||
arm: armv4_5_crc.inc armv7m_crc.inc
|
||||
|
||||
riscv: riscv32_crc.inc riscv64_crc.inc
|
||||
|
||||
armv4_5_%.elf: armv4_5_%.s
|
||||
$(ARM_AS) $(ARM_AFLAGS) $< -o $@
|
||||
|
||||
armv4_5_%.bin: armv4_5_%.elf
|
||||
$(ARM_OBJCOPY) -Obinary $< $@
|
||||
|
||||
armv7m_%.elf: armv7m_%.s
|
||||
$(ARM_AS) $(ARM_AFLAGS) $< -o $@
|
||||
|
||||
armv7m_%.bin: armv7m_%.elf
|
||||
$(ARM_OBJCOPY) -Obinary $< $@
|
||||
|
||||
%.inc: %.bin
|
||||
$(BIN2C) < $< > $@
|
||||
|
||||
riscv32_%.elf: riscv_%.c
|
||||
$(RISCV_CC) $(RISCV32_CFLAGS) $< -o $@
|
||||
|
||||
riscv64_%.elf: riscv_%.c
|
||||
$(RISCV_CC) $(RISCV64_CFLAGS) $< -o $@
|
||||
|
||||
riscv%.bin: riscv%.elf
|
||||
$(RISCV_OBJCOPY) -Obinary $< $@
|
||||
|
||||
clean:
|
||||
-rm -f *.elf *.bin *.inc
|
|
@ -1,7 +0,0 @@
|
|||
/* Autogenerated with ../../../src/helper/bin2char.sh */
|
||||
0x00,0x20,0xa0,0xe1,0x00,0x00,0xe0,0xe3,0x01,0x30,0xa0,0xe1,0x00,0x40,0xa0,0xe3,
|
||||
0x0b,0x00,0x00,0xea,0x04,0x10,0xd2,0xe7,0x30,0x70,0x9f,0xe5,0x01,0x0c,0x20,0xe0,
|
||||
0x00,0x50,0xa0,0xe3,0x00,0x00,0x50,0xe3,0x80,0x60,0xa0,0xe1,0x01,0x50,0x85,0xe2,
|
||||
0x06,0x00,0xa0,0xe1,0x07,0x00,0x26,0xb0,0x08,0x00,0x55,0xe3,0xf8,0xff,0xff,0x1a,
|
||||
0x01,0x40,0x84,0xe2,0x03,0x00,0x54,0xe1,0xf1,0xff,0xff,0x1a,0x70,0x00,0x20,0xe1,
|
||||
0xb7,0x1d,0xc1,0x04,
|
|
@ -15,7 +15,7 @@
|
|||
* You should have received a copy of the GNU General Public License *
|
||||
* along with this program; if not, write to the *
|
||||
* Free Software Foundation, Inc., *
|
||||
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. *
|
||||
* 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. *
|
||||
***************************************************************************/
|
||||
|
||||
/*
|
||||
|
|
|
@ -1,5 +0,0 @@
|
|||
/* Autogenerated with ../../../src/helper/bin2char.sh */
|
||||
0x02,0x46,0x00,0x20,0xc0,0x43,0x0a,0x4e,0x0b,0x46,0x00,0x24,0x0d,0xe0,0x11,0x5d,
|
||||
0x09,0x06,0x48,0x40,0x00,0x25,0x00,0x28,0x02,0xda,0x40,0x00,0x70,0x40,0x00,0xe0,
|
||||
0x40,0x00,0x01,0x35,0x08,0x2d,0xf6,0xd1,0x01,0x34,0x9c,0x42,0xef,0xd1,0x00,0xbe,
|
||||
0xb7,0x1d,0xc1,0x04,
|
|
@ -15,7 +15,7 @@
|
|||
* You should have received a copy of the GNU General Public License *
|
||||
* along with this program; if not, write to the *
|
||||
* Free Software Foundation, Inc., *
|
||||
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. *
|
||||
* 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. *
|
||||
***************************************************************************/
|
||||
|
||||
/*
|
||||
|
|
|
@ -15,7 +15,7 @@
|
|||
* You should have received a copy of the GNU General Public License *
|
||||
* along with this program; if not, write to the *
|
||||
* Free Software Foundation, Inc., *
|
||||
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. *
|
||||
* 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. *
|
||||
***************************************************************************/
|
||||
|
||||
.global main
|
||||
|
@ -31,7 +31,7 @@
|
|||
* temps:
|
||||
* t3 v0 a3 a2 t0 v1
|
||||
*/
|
||||
|
||||
|
||||
.ent main
|
||||
main:
|
||||
addiu $t4, $a0, 0 /* address in */
|
||||
|
@ -65,7 +65,7 @@ loop:
|
|||
ncomp:
|
||||
bne $t2, $t3, nbyte /* all bytes processed */
|
||||
addiu $t3, $t3, 1
|
||||
|
||||
|
||||
wait:
|
||||
sdbbp
|
||||
|
||||
|
|
|
@ -1,70 +0,0 @@
|
|||
/* Autogenerated with ../../../src/helper/bin2char.sh */
|
||||
0xb3,0x05,0xb5,0x00,0x93,0x07,0xf0,0xff,0x17,0x07,0x00,0x00,0x13,0x07,0x47,0x04,
|
||||
0x63,0x1a,0xb5,0x00,0x13,0x85,0x07,0x00,0x73,0x00,0x10,0x00,0x13,0x85,0x07,0x00,
|
||||
0x67,0x80,0x00,0x00,0x03,0x46,0x05,0x00,0x93,0x96,0x87,0x00,0x93,0xd7,0x87,0x01,
|
||||
0xb3,0xc7,0xc7,0x00,0x93,0x97,0x27,0x00,0xb3,0x07,0xf7,0x00,0x83,0xa7,0x07,0x00,
|
||||
0x13,0x05,0x15,0x00,0xb3,0xc7,0xf6,0x00,0x6f,0xf0,0x9f,0xfc,0x00,0x00,0x00,0x00,
|
||||
0xb7,0x1d,0xc1,0x04,0x6e,0x3b,0x82,0x09,0xd9,0x26,0x43,0x0d,0xdc,0x76,0x04,0x13,
|
||||
0x6b,0x6b,0xc5,0x17,0xb2,0x4d,0x86,0x1a,0x05,0x50,0x47,0x1e,0xb8,0xed,0x08,0x26,
|
||||
0x0f,0xf0,0xc9,0x22,0xd6,0xd6,0x8a,0x2f,0x61,0xcb,0x4b,0x2b,0x64,0x9b,0x0c,0x35,
|
||||
0xd3,0x86,0xcd,0x31,0x0a,0xa0,0x8e,0x3c,0xbd,0xbd,0x4f,0x38,0x70,0xdb,0x11,0x4c,
|
||||
0xc7,0xc6,0xd0,0x48,0x1e,0xe0,0x93,0x45,0xa9,0xfd,0x52,0x41,0xac,0xad,0x15,0x5f,
|
||||
0x1b,0xb0,0xd4,0x5b,0xc2,0x96,0x97,0x56,0x75,0x8b,0x56,0x52,0xc8,0x36,0x19,0x6a,
|
||||
0x7f,0x2b,0xd8,0x6e,0xa6,0x0d,0x9b,0x63,0x11,0x10,0x5a,0x67,0x14,0x40,0x1d,0x79,
|
||||
0xa3,0x5d,0xdc,0x7d,0x7a,0x7b,0x9f,0x70,0xcd,0x66,0x5e,0x74,0xe0,0xb6,0x23,0x98,
|
||||
0x57,0xab,0xe2,0x9c,0x8e,0x8d,0xa1,0x91,0x39,0x90,0x60,0x95,0x3c,0xc0,0x27,0x8b,
|
||||
0x8b,0xdd,0xe6,0x8f,0x52,0xfb,0xa5,0x82,0xe5,0xe6,0x64,0x86,0x58,0x5b,0x2b,0xbe,
|
||||
0xef,0x46,0xea,0xba,0x36,0x60,0xa9,0xb7,0x81,0x7d,0x68,0xb3,0x84,0x2d,0x2f,0xad,
|
||||
0x33,0x30,0xee,0xa9,0xea,0x16,0xad,0xa4,0x5d,0x0b,0x6c,0xa0,0x90,0x6d,0x32,0xd4,
|
||||
0x27,0x70,0xf3,0xd0,0xfe,0x56,0xb0,0xdd,0x49,0x4b,0x71,0xd9,0x4c,0x1b,0x36,0xc7,
|
||||
0xfb,0x06,0xf7,0xc3,0x22,0x20,0xb4,0xce,0x95,0x3d,0x75,0xca,0x28,0x80,0x3a,0xf2,
|
||||
0x9f,0x9d,0xfb,0xf6,0x46,0xbb,0xb8,0xfb,0xf1,0xa6,0x79,0xff,0xf4,0xf6,0x3e,0xe1,
|
||||
0x43,0xeb,0xff,0xe5,0x9a,0xcd,0xbc,0xe8,0x2d,0xd0,0x7d,0xec,0x77,0x70,0x86,0x34,
|
||||
0xc0,0x6d,0x47,0x30,0x19,0x4b,0x04,0x3d,0xae,0x56,0xc5,0x39,0xab,0x06,0x82,0x27,
|
||||
0x1c,0x1b,0x43,0x23,0xc5,0x3d,0x00,0x2e,0x72,0x20,0xc1,0x2a,0xcf,0x9d,0x8e,0x12,
|
||||
0x78,0x80,0x4f,0x16,0xa1,0xa6,0x0c,0x1b,0x16,0xbb,0xcd,0x1f,0x13,0xeb,0x8a,0x01,
|
||||
0xa4,0xf6,0x4b,0x05,0x7d,0xd0,0x08,0x08,0xca,0xcd,0xc9,0x0c,0x07,0xab,0x97,0x78,
|
||||
0xb0,0xb6,0x56,0x7c,0x69,0x90,0x15,0x71,0xde,0x8d,0xd4,0x75,0xdb,0xdd,0x93,0x6b,
|
||||
0x6c,0xc0,0x52,0x6f,0xb5,0xe6,0x11,0x62,0x02,0xfb,0xd0,0x66,0xbf,0x46,0x9f,0x5e,
|
||||
0x08,0x5b,0x5e,0x5a,0xd1,0x7d,0x1d,0x57,0x66,0x60,0xdc,0x53,0x63,0x30,0x9b,0x4d,
|
||||
0xd4,0x2d,0x5a,0x49,0x0d,0x0b,0x19,0x44,0xba,0x16,0xd8,0x40,0x97,0xc6,0xa5,0xac,
|
||||
0x20,0xdb,0x64,0xa8,0xf9,0xfd,0x27,0xa5,0x4e,0xe0,0xe6,0xa1,0x4b,0xb0,0xa1,0xbf,
|
||||
0xfc,0xad,0x60,0xbb,0x25,0x8b,0x23,0xb6,0x92,0x96,0xe2,0xb2,0x2f,0x2b,0xad,0x8a,
|
||||
0x98,0x36,0x6c,0x8e,0x41,0x10,0x2f,0x83,0xf6,0x0d,0xee,0x87,0xf3,0x5d,0xa9,0x99,
|
||||
0x44,0x40,0x68,0x9d,0x9d,0x66,0x2b,0x90,0x2a,0x7b,0xea,0x94,0xe7,0x1d,0xb4,0xe0,
|
||||
0x50,0x00,0x75,0xe4,0x89,0x26,0x36,0xe9,0x3e,0x3b,0xf7,0xed,0x3b,0x6b,0xb0,0xf3,
|
||||
0x8c,0x76,0x71,0xf7,0x55,0x50,0x32,0xfa,0xe2,0x4d,0xf3,0xfe,0x5f,0xf0,0xbc,0xc6,
|
||||
0xe8,0xed,0x7d,0xc2,0x31,0xcb,0x3e,0xcf,0x86,0xd6,0xff,0xcb,0x83,0x86,0xb8,0xd5,
|
||||
0x34,0x9b,0x79,0xd1,0xed,0xbd,0x3a,0xdc,0x5a,0xa0,0xfb,0xd8,0xee,0xe0,0x0c,0x69,
|
||||
0x59,0xfd,0xcd,0x6d,0x80,0xdb,0x8e,0x60,0x37,0xc6,0x4f,0x64,0x32,0x96,0x08,0x7a,
|
||||
0x85,0x8b,0xc9,0x7e,0x5c,0xad,0x8a,0x73,0xeb,0xb0,0x4b,0x77,0x56,0x0d,0x04,0x4f,
|
||||
0xe1,0x10,0xc5,0x4b,0x38,0x36,0x86,0x46,0x8f,0x2b,0x47,0x42,0x8a,0x7b,0x00,0x5c,
|
||||
0x3d,0x66,0xc1,0x58,0xe4,0x40,0x82,0x55,0x53,0x5d,0x43,0x51,0x9e,0x3b,0x1d,0x25,
|
||||
0x29,0x26,0xdc,0x21,0xf0,0x00,0x9f,0x2c,0x47,0x1d,0x5e,0x28,0x42,0x4d,0x19,0x36,
|
||||
0xf5,0x50,0xd8,0x32,0x2c,0x76,0x9b,0x3f,0x9b,0x6b,0x5a,0x3b,0x26,0xd6,0x15,0x03,
|
||||
0x91,0xcb,0xd4,0x07,0x48,0xed,0x97,0x0a,0xff,0xf0,0x56,0x0e,0xfa,0xa0,0x11,0x10,
|
||||
0x4d,0xbd,0xd0,0x14,0x94,0x9b,0x93,0x19,0x23,0x86,0x52,0x1d,0x0e,0x56,0x2f,0xf1,
|
||||
0xb9,0x4b,0xee,0xf5,0x60,0x6d,0xad,0xf8,0xd7,0x70,0x6c,0xfc,0xd2,0x20,0x2b,0xe2,
|
||||
0x65,0x3d,0xea,0xe6,0xbc,0x1b,0xa9,0xeb,0x0b,0x06,0x68,0xef,0xb6,0xbb,0x27,0xd7,
|
||||
0x01,0xa6,0xe6,0xd3,0xd8,0x80,0xa5,0xde,0x6f,0x9d,0x64,0xda,0x6a,0xcd,0x23,0xc4,
|
||||
0xdd,0xd0,0xe2,0xc0,0x04,0xf6,0xa1,0xcd,0xb3,0xeb,0x60,0xc9,0x7e,0x8d,0x3e,0xbd,
|
||||
0xc9,0x90,0xff,0xb9,0x10,0xb6,0xbc,0xb4,0xa7,0xab,0x7d,0xb0,0xa2,0xfb,0x3a,0xae,
|
||||
0x15,0xe6,0xfb,0xaa,0xcc,0xc0,0xb8,0xa7,0x7b,0xdd,0x79,0xa3,0xc6,0x60,0x36,0x9b,
|
||||
0x71,0x7d,0xf7,0x9f,0xa8,0x5b,0xb4,0x92,0x1f,0x46,0x75,0x96,0x1a,0x16,0x32,0x88,
|
||||
0xad,0x0b,0xf3,0x8c,0x74,0x2d,0xb0,0x81,0xc3,0x30,0x71,0x85,0x99,0x90,0x8a,0x5d,
|
||||
0x2e,0x8d,0x4b,0x59,0xf7,0xab,0x08,0x54,0x40,0xb6,0xc9,0x50,0x45,0xe6,0x8e,0x4e,
|
||||
0xf2,0xfb,0x4f,0x4a,0x2b,0xdd,0x0c,0x47,0x9c,0xc0,0xcd,0x43,0x21,0x7d,0x82,0x7b,
|
||||
0x96,0x60,0x43,0x7f,0x4f,0x46,0x00,0x72,0xf8,0x5b,0xc1,0x76,0xfd,0x0b,0x86,0x68,
|
||||
0x4a,0x16,0x47,0x6c,0x93,0x30,0x04,0x61,0x24,0x2d,0xc5,0x65,0xe9,0x4b,0x9b,0x11,
|
||||
0x5e,0x56,0x5a,0x15,0x87,0x70,0x19,0x18,0x30,0x6d,0xd8,0x1c,0x35,0x3d,0x9f,0x02,
|
||||
0x82,0x20,0x5e,0x06,0x5b,0x06,0x1d,0x0b,0xec,0x1b,0xdc,0x0f,0x51,0xa6,0x93,0x37,
|
||||
0xe6,0xbb,0x52,0x33,0x3f,0x9d,0x11,0x3e,0x88,0x80,0xd0,0x3a,0x8d,0xd0,0x97,0x24,
|
||||
0x3a,0xcd,0x56,0x20,0xe3,0xeb,0x15,0x2d,0x54,0xf6,0xd4,0x29,0x79,0x26,0xa9,0xc5,
|
||||
0xce,0x3b,0x68,0xc1,0x17,0x1d,0x2b,0xcc,0xa0,0x00,0xea,0xc8,0xa5,0x50,0xad,0xd6,
|
||||
0x12,0x4d,0x6c,0xd2,0xcb,0x6b,0x2f,0xdf,0x7c,0x76,0xee,0xdb,0xc1,0xcb,0xa1,0xe3,
|
||||
0x76,0xd6,0x60,0xe7,0xaf,0xf0,0x23,0xea,0x18,0xed,0xe2,0xee,0x1d,0xbd,0xa5,0xf0,
|
||||
0xaa,0xa0,0x64,0xf4,0x73,0x86,0x27,0xf9,0xc4,0x9b,0xe6,0xfd,0x09,0xfd,0xb8,0x89,
|
||||
0xbe,0xe0,0x79,0x8d,0x67,0xc6,0x3a,0x80,0xd0,0xdb,0xfb,0x84,0xd5,0x8b,0xbc,0x9a,
|
||||
0x62,0x96,0x7d,0x9e,0xbb,0xb0,0x3e,0x93,0x0c,0xad,0xff,0x97,0xb1,0x10,0xb0,0xaf,
|
||||
0x06,0x0d,0x71,0xab,0xdf,0x2b,0x32,0xa6,0x68,0x36,0xf3,0xa2,0x6d,0x66,0xb4,0xbc,
|
||||
0xda,0x7b,0x75,0xb8,0x03,0x5d,0x36,0xb5,0xb4,0x40,0xf7,0xb1,
|
|
@ -1,71 +0,0 @@
|
|||
/* Autogenerated with ../../../src/helper/bin2char.sh */
|
||||
0x93,0x07,0xf0,0xff,0x93,0x06,0xf0,0xff,0x17,0x06,0x00,0x00,0x13,0x06,0x06,0x05,
|
||||
0x9b,0x85,0xf5,0xff,0x63,0x9a,0xd5,0x00,0x13,0x85,0x07,0x00,0x73,0x00,0x10,0x00,
|
||||
0x13,0x85,0x07,0x00,0x67,0x80,0x00,0x00,0x83,0x48,0x05,0x00,0x1b,0xd7,0x87,0x01,
|
||||
0x1b,0x98,0x87,0x00,0x33,0x47,0x17,0x01,0x13,0x17,0x27,0x00,0x33,0x07,0xe6,0x00,
|
||||
0x83,0x27,0x07,0x00,0x13,0x05,0x15,0x00,0xb3,0xc7,0x07,0x01,0x9b,0x87,0x07,0x00,
|
||||
0x6f,0xf0,0x1f,0xfc,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xb7,0x1d,0xc1,0x04,
|
||||
0x6e,0x3b,0x82,0x09,0xd9,0x26,0x43,0x0d,0xdc,0x76,0x04,0x13,0x6b,0x6b,0xc5,0x17,
|
||||
0xb2,0x4d,0x86,0x1a,0x05,0x50,0x47,0x1e,0xb8,0xed,0x08,0x26,0x0f,0xf0,0xc9,0x22,
|
||||
0xd6,0xd6,0x8a,0x2f,0x61,0xcb,0x4b,0x2b,0x64,0x9b,0x0c,0x35,0xd3,0x86,0xcd,0x31,
|
||||
0x0a,0xa0,0x8e,0x3c,0xbd,0xbd,0x4f,0x38,0x70,0xdb,0x11,0x4c,0xc7,0xc6,0xd0,0x48,
|
||||
0x1e,0xe0,0x93,0x45,0xa9,0xfd,0x52,0x41,0xac,0xad,0x15,0x5f,0x1b,0xb0,0xd4,0x5b,
|
||||
0xc2,0x96,0x97,0x56,0x75,0x8b,0x56,0x52,0xc8,0x36,0x19,0x6a,0x7f,0x2b,0xd8,0x6e,
|
||||
0xa6,0x0d,0x9b,0x63,0x11,0x10,0x5a,0x67,0x14,0x40,0x1d,0x79,0xa3,0x5d,0xdc,0x7d,
|
||||
0x7a,0x7b,0x9f,0x70,0xcd,0x66,0x5e,0x74,0xe0,0xb6,0x23,0x98,0x57,0xab,0xe2,0x9c,
|
||||
0x8e,0x8d,0xa1,0x91,0x39,0x90,0x60,0x95,0x3c,0xc0,0x27,0x8b,0x8b,0xdd,0xe6,0x8f,
|
||||
0x52,0xfb,0xa5,0x82,0xe5,0xe6,0x64,0x86,0x58,0x5b,0x2b,0xbe,0xef,0x46,0xea,0xba,
|
||||
0x36,0x60,0xa9,0xb7,0x81,0x7d,0x68,0xb3,0x84,0x2d,0x2f,0xad,0x33,0x30,0xee,0xa9,
|
||||
0xea,0x16,0xad,0xa4,0x5d,0x0b,0x6c,0xa0,0x90,0x6d,0x32,0xd4,0x27,0x70,0xf3,0xd0,
|
||||
0xfe,0x56,0xb0,0xdd,0x49,0x4b,0x71,0xd9,0x4c,0x1b,0x36,0xc7,0xfb,0x06,0xf7,0xc3,
|
||||
0x22,0x20,0xb4,0xce,0x95,0x3d,0x75,0xca,0x28,0x80,0x3a,0xf2,0x9f,0x9d,0xfb,0xf6,
|
||||
0x46,0xbb,0xb8,0xfb,0xf1,0xa6,0x79,0xff,0xf4,0xf6,0x3e,0xe1,0x43,0xeb,0xff,0xe5,
|
||||
0x9a,0xcd,0xbc,0xe8,0x2d,0xd0,0x7d,0xec,0x77,0x70,0x86,0x34,0xc0,0x6d,0x47,0x30,
|
||||
0x19,0x4b,0x04,0x3d,0xae,0x56,0xc5,0x39,0xab,0x06,0x82,0x27,0x1c,0x1b,0x43,0x23,
|
||||
0xc5,0x3d,0x00,0x2e,0x72,0x20,0xc1,0x2a,0xcf,0x9d,0x8e,0x12,0x78,0x80,0x4f,0x16,
|
||||
0xa1,0xa6,0x0c,0x1b,0x16,0xbb,0xcd,0x1f,0x13,0xeb,0x8a,0x01,0xa4,0xf6,0x4b,0x05,
|
||||
0x7d,0xd0,0x08,0x08,0xca,0xcd,0xc9,0x0c,0x07,0xab,0x97,0x78,0xb0,0xb6,0x56,0x7c,
|
||||
0x69,0x90,0x15,0x71,0xde,0x8d,0xd4,0x75,0xdb,0xdd,0x93,0x6b,0x6c,0xc0,0x52,0x6f,
|
||||
0xb5,0xe6,0x11,0x62,0x02,0xfb,0xd0,0x66,0xbf,0x46,0x9f,0x5e,0x08,0x5b,0x5e,0x5a,
|
||||
0xd1,0x7d,0x1d,0x57,0x66,0x60,0xdc,0x53,0x63,0x30,0x9b,0x4d,0xd4,0x2d,0x5a,0x49,
|
||||
0x0d,0x0b,0x19,0x44,0xba,0x16,0xd8,0x40,0x97,0xc6,0xa5,0xac,0x20,0xdb,0x64,0xa8,
|
||||
0xf9,0xfd,0x27,0xa5,0x4e,0xe0,0xe6,0xa1,0x4b,0xb0,0xa1,0xbf,0xfc,0xad,0x60,0xbb,
|
||||
0x25,0x8b,0x23,0xb6,0x92,0x96,0xe2,0xb2,0x2f,0x2b,0xad,0x8a,0x98,0x36,0x6c,0x8e,
|
||||
0x41,0x10,0x2f,0x83,0xf6,0x0d,0xee,0x87,0xf3,0x5d,0xa9,0x99,0x44,0x40,0x68,0x9d,
|
||||
0x9d,0x66,0x2b,0x90,0x2a,0x7b,0xea,0x94,0xe7,0x1d,0xb4,0xe0,0x50,0x00,0x75,0xe4,
|
||||
0x89,0x26,0x36,0xe9,0x3e,0x3b,0xf7,0xed,0x3b,0x6b,0xb0,0xf3,0x8c,0x76,0x71,0xf7,
|
||||
0x55,0x50,0x32,0xfa,0xe2,0x4d,0xf3,0xfe,0x5f,0xf0,0xbc,0xc6,0xe8,0xed,0x7d,0xc2,
|
||||
0x31,0xcb,0x3e,0xcf,0x86,0xd6,0xff,0xcb,0x83,0x86,0xb8,0xd5,0x34,0x9b,0x79,0xd1,
|
||||
0xed,0xbd,0x3a,0xdc,0x5a,0xa0,0xfb,0xd8,0xee,0xe0,0x0c,0x69,0x59,0xfd,0xcd,0x6d,
|
||||
0x80,0xdb,0x8e,0x60,0x37,0xc6,0x4f,0x64,0x32,0x96,0x08,0x7a,0x85,0x8b,0xc9,0x7e,
|
||||
0x5c,0xad,0x8a,0x73,0xeb,0xb0,0x4b,0x77,0x56,0x0d,0x04,0x4f,0xe1,0x10,0xc5,0x4b,
|
||||
0x38,0x36,0x86,0x46,0x8f,0x2b,0x47,0x42,0x8a,0x7b,0x00,0x5c,0x3d,0x66,0xc1,0x58,
|
||||
0xe4,0x40,0x82,0x55,0x53,0x5d,0x43,0x51,0x9e,0x3b,0x1d,0x25,0x29,0x26,0xdc,0x21,
|
||||
0xf0,0x00,0x9f,0x2c,0x47,0x1d,0x5e,0x28,0x42,0x4d,0x19,0x36,0xf5,0x50,0xd8,0x32,
|
||||
0x2c,0x76,0x9b,0x3f,0x9b,0x6b,0x5a,0x3b,0x26,0xd6,0x15,0x03,0x91,0xcb,0xd4,0x07,
|
||||
0x48,0xed,0x97,0x0a,0xff,0xf0,0x56,0x0e,0xfa,0xa0,0x11,0x10,0x4d,0xbd,0xd0,0x14,
|
||||
0x94,0x9b,0x93,0x19,0x23,0x86,0x52,0x1d,0x0e,0x56,0x2f,0xf1,0xb9,0x4b,0xee,0xf5,
|
||||
0x60,0x6d,0xad,0xf8,0xd7,0x70,0x6c,0xfc,0xd2,0x20,0x2b,0xe2,0x65,0x3d,0xea,0xe6,
|
||||
0xbc,0x1b,0xa9,0xeb,0x0b,0x06,0x68,0xef,0xb6,0xbb,0x27,0xd7,0x01,0xa6,0xe6,0xd3,
|
||||
0xd8,0x80,0xa5,0xde,0x6f,0x9d,0x64,0xda,0x6a,0xcd,0x23,0xc4,0xdd,0xd0,0xe2,0xc0,
|
||||
0x04,0xf6,0xa1,0xcd,0xb3,0xeb,0x60,0xc9,0x7e,0x8d,0x3e,0xbd,0xc9,0x90,0xff,0xb9,
|
||||
0x10,0xb6,0xbc,0xb4,0xa7,0xab,0x7d,0xb0,0xa2,0xfb,0x3a,0xae,0x15,0xe6,0xfb,0xaa,
|
||||
0xcc,0xc0,0xb8,0xa7,0x7b,0xdd,0x79,0xa3,0xc6,0x60,0x36,0x9b,0x71,0x7d,0xf7,0x9f,
|
||||
0xa8,0x5b,0xb4,0x92,0x1f,0x46,0x75,0x96,0x1a,0x16,0x32,0x88,0xad,0x0b,0xf3,0x8c,
|
||||
0x74,0x2d,0xb0,0x81,0xc3,0x30,0x71,0x85,0x99,0x90,0x8a,0x5d,0x2e,0x8d,0x4b,0x59,
|
||||
0xf7,0xab,0x08,0x54,0x40,0xb6,0xc9,0x50,0x45,0xe6,0x8e,0x4e,0xf2,0xfb,0x4f,0x4a,
|
||||
0x2b,0xdd,0x0c,0x47,0x9c,0xc0,0xcd,0x43,0x21,0x7d,0x82,0x7b,0x96,0x60,0x43,0x7f,
|
||||
0x4f,0x46,0x00,0x72,0xf8,0x5b,0xc1,0x76,0xfd,0x0b,0x86,0x68,0x4a,0x16,0x47,0x6c,
|
||||
0x93,0x30,0x04,0x61,0x24,0x2d,0xc5,0x65,0xe9,0x4b,0x9b,0x11,0x5e,0x56,0x5a,0x15,
|
||||
0x87,0x70,0x19,0x18,0x30,0x6d,0xd8,0x1c,0x35,0x3d,0x9f,0x02,0x82,0x20,0x5e,0x06,
|
||||
0x5b,0x06,0x1d,0x0b,0xec,0x1b,0xdc,0x0f,0x51,0xa6,0x93,0x37,0xe6,0xbb,0x52,0x33,
|
||||
0x3f,0x9d,0x11,0x3e,0x88,0x80,0xd0,0x3a,0x8d,0xd0,0x97,0x24,0x3a,0xcd,0x56,0x20,
|
||||
0xe3,0xeb,0x15,0x2d,0x54,0xf6,0xd4,0x29,0x79,0x26,0xa9,0xc5,0xce,0x3b,0x68,0xc1,
|
||||
0x17,0x1d,0x2b,0xcc,0xa0,0x00,0xea,0xc8,0xa5,0x50,0xad,0xd6,0x12,0x4d,0x6c,0xd2,
|
||||
0xcb,0x6b,0x2f,0xdf,0x7c,0x76,0xee,0xdb,0xc1,0xcb,0xa1,0xe3,0x76,0xd6,0x60,0xe7,
|
||||
0xaf,0xf0,0x23,0xea,0x18,0xed,0xe2,0xee,0x1d,0xbd,0xa5,0xf0,0xaa,0xa0,0x64,0xf4,
|
||||
0x73,0x86,0x27,0xf9,0xc4,0x9b,0xe6,0xfd,0x09,0xfd,0xb8,0x89,0xbe,0xe0,0x79,0x8d,
|
||||
0x67,0xc6,0x3a,0x80,0xd0,0xdb,0xfb,0x84,0xd5,0x8b,0xbc,0x9a,0x62,0x96,0x7d,0x9e,
|
||||
0xbb,0xb0,0x3e,0x93,0x0c,0xad,0xff,0x97,0xb1,0x10,0xb0,0xaf,0x06,0x0d,0x71,0xab,
|
||||
0xdf,0x2b,0x32,0xa6,0x68,0x36,0xf3,0xa2,0x6d,0x66,0xb4,0xbc,0xda,0x7b,0x75,0xb8,
|
||||
0x03,0x5d,0x36,0xb5,0xb4,0x40,0xf7,0xb1,
|
|
@ -1,140 +0,0 @@
|
|||
/*
|
||||
* SPDX-License-Identifier: GPL-2.0-or-later
|
||||
* Copyright (C) 2009-2021 Free Software Foundation, Inc.
|
||||
*/
|
||||
|
||||
/* Copied from https://github.com/gcc-mirror/gcc/blob/master/libiberty/crc32.c
|
||||
* and then tweaked a little. */
|
||||
|
||||
/* This table was generated by the following program.
|
||||
#include <stdio.h>
|
||||
int
|
||||
main ()
|
||||
{
|
||||
unsigned int i, j;
|
||||
unsigned int c;
|
||||
int table[256];
|
||||
for (i = 0; i < 256; i++)
|
||||
{
|
||||
for (c = i << 24, j = 8; j > 0; --j)
|
||||
c = c & 0x80000000 ? (c << 1) ^ 0x04c11db7 : (c << 1);
|
||||
table[i] = c;
|
||||
}
|
||||
printf ("static const unsigned int crc32_table[] =\n{\n");
|
||||
for (i = 0; i < 256; i += 4)
|
||||
{
|
||||
printf (" 0x%08x, 0x%08x, 0x%08x, 0x%08x",
|
||||
table[i + 0], table[i + 1], table[i + 2], table[i + 3]);
|
||||
if (i + 4 < 256)
|
||||
putchar (',');
|
||||
putchar ('\n');
|
||||
}
|
||||
printf ("};\n");
|
||||
return 0;
|
||||
}
|
||||
For more information on CRC, see, e.g.,
|
||||
http://www.ross.net/crc/download/crc_v3.txt. */
|
||||
|
||||
static const unsigned int crc32_table[] = {
|
||||
0x00000000, 0x04c11db7, 0x09823b6e, 0x0d4326d9,
|
||||
0x130476dc, 0x17c56b6b, 0x1a864db2, 0x1e475005,
|
||||
0x2608edb8, 0x22c9f00f, 0x2f8ad6d6, 0x2b4bcb61,
|
||||
0x350c9b64, 0x31cd86d3, 0x3c8ea00a, 0x384fbdbd,
|
||||
0x4c11db70, 0x48d0c6c7, 0x4593e01e, 0x4152fda9,
|
||||
0x5f15adac, 0x5bd4b01b, 0x569796c2, 0x52568b75,
|
||||
0x6a1936c8, 0x6ed82b7f, 0x639b0da6, 0x675a1011,
|
||||
0x791d4014, 0x7ddc5da3, 0x709f7b7a, 0x745e66cd,
|
||||
0x9823b6e0, 0x9ce2ab57, 0x91a18d8e, 0x95609039,
|
||||
0x8b27c03c, 0x8fe6dd8b, 0x82a5fb52, 0x8664e6e5,
|
||||
0xbe2b5b58, 0xbaea46ef, 0xb7a96036, 0xb3687d81,
|
||||
0xad2f2d84, 0xa9ee3033, 0xa4ad16ea, 0xa06c0b5d,
|
||||
0xd4326d90, 0xd0f37027, 0xddb056fe, 0xd9714b49,
|
||||
0xc7361b4c, 0xc3f706fb, 0xceb42022, 0xca753d95,
|
||||
0xf23a8028, 0xf6fb9d9f, 0xfbb8bb46, 0xff79a6f1,
|
||||
0xe13ef6f4, 0xe5ffeb43, 0xe8bccd9a, 0xec7dd02d,
|
||||
0x34867077, 0x30476dc0, 0x3d044b19, 0x39c556ae,
|
||||
0x278206ab, 0x23431b1c, 0x2e003dc5, 0x2ac12072,
|
||||
0x128e9dcf, 0x164f8078, 0x1b0ca6a1, 0x1fcdbb16,
|
||||
0x018aeb13, 0x054bf6a4, 0x0808d07d, 0x0cc9cdca,
|
||||
0x7897ab07, 0x7c56b6b0, 0x71159069, 0x75d48dde,
|
||||
0x6b93dddb, 0x6f52c06c, 0x6211e6b5, 0x66d0fb02,
|
||||
0x5e9f46bf, 0x5a5e5b08, 0x571d7dd1, 0x53dc6066,
|
||||
0x4d9b3063, 0x495a2dd4, 0x44190b0d, 0x40d816ba,
|
||||
0xaca5c697, 0xa864db20, 0xa527fdf9, 0xa1e6e04e,
|
||||
0xbfa1b04b, 0xbb60adfc, 0xb6238b25, 0xb2e29692,
|
||||
0x8aad2b2f, 0x8e6c3698, 0x832f1041, 0x87ee0df6,
|
||||
0x99a95df3, 0x9d684044, 0x902b669d, 0x94ea7b2a,
|
||||
0xe0b41de7, 0xe4750050, 0xe9362689, 0xedf73b3e,
|
||||
0xf3b06b3b, 0xf771768c, 0xfa325055, 0xfef34de2,
|
||||
0xc6bcf05f, 0xc27dede8, 0xcf3ecb31, 0xcbffd686,
|
||||
0xd5b88683, 0xd1799b34, 0xdc3abded, 0xd8fba05a,
|
||||
0x690ce0ee, 0x6dcdfd59, 0x608edb80, 0x644fc637,
|
||||
0x7a089632, 0x7ec98b85, 0x738aad5c, 0x774bb0eb,
|
||||
0x4f040d56, 0x4bc510e1, 0x46863638, 0x42472b8f,
|
||||
0x5c007b8a, 0x58c1663d, 0x558240e4, 0x51435d53,
|
||||
0x251d3b9e, 0x21dc2629, 0x2c9f00f0, 0x285e1d47,
|
||||
0x36194d42, 0x32d850f5, 0x3f9b762c, 0x3b5a6b9b,
|
||||
0x0315d626, 0x07d4cb91, 0x0a97ed48, 0x0e56f0ff,
|
||||
0x1011a0fa, 0x14d0bd4d, 0x19939b94, 0x1d528623,
|
||||
0xf12f560e, 0xf5ee4bb9, 0xf8ad6d60, 0xfc6c70d7,
|
||||
0xe22b20d2, 0xe6ea3d65, 0xeba91bbc, 0xef68060b,
|
||||
0xd727bbb6, 0xd3e6a601, 0xdea580d8, 0xda649d6f,
|
||||
0xc423cd6a, 0xc0e2d0dd, 0xcda1f604, 0xc960ebb3,
|
||||
0xbd3e8d7e, 0xb9ff90c9, 0xb4bcb610, 0xb07daba7,
|
||||
0xae3afba2, 0xaafbe615, 0xa7b8c0cc, 0xa379dd7b,
|
||||
0x9b3660c6, 0x9ff77d71, 0x92b45ba8, 0x9675461f,
|
||||
0x8832161a, 0x8cf30bad, 0x81b02d74, 0x857130c3,
|
||||
0x5d8a9099, 0x594b8d2e, 0x5408abf7, 0x50c9b640,
|
||||
0x4e8ee645, 0x4a4ffbf2, 0x470cdd2b, 0x43cdc09c,
|
||||
0x7b827d21, 0x7f436096, 0x7200464f, 0x76c15bf8,
|
||||
0x68860bfd, 0x6c47164a, 0x61043093, 0x65c52d24,
|
||||
0x119b4be9, 0x155a565e, 0x18197087, 0x1cd86d30,
|
||||
0x029f3d35, 0x065e2082, 0x0b1d065b, 0x0fdc1bec,
|
||||
0x3793a651, 0x3352bbe6, 0x3e119d3f, 0x3ad08088,
|
||||
0x2497d08d, 0x2056cd3a, 0x2d15ebe3, 0x29d4f654,
|
||||
0xc5a92679, 0xc1683bce, 0xcc2b1d17, 0xc8ea00a0,
|
||||
0xd6ad50a5, 0xd26c4d12, 0xdf2f6bcb, 0xdbee767c,
|
||||
0xe3a1cbc1, 0xe760d676, 0xea23f0af, 0xeee2ed18,
|
||||
0xf0a5bd1d, 0xf464a0aa, 0xf9278673, 0xfde69bc4,
|
||||
0x89b8fd09, 0x8d79e0be, 0x803ac667, 0x84fbdbd0,
|
||||
0x9abc8bd5, 0x9e7d9662, 0x933eb0bb, 0x97ffad0c,
|
||||
0xafb010b1, 0xab710d06, 0xa6322bdf, 0xa2f33668,
|
||||
0xbcb4666d, 0xb8757bda, 0xb5365d03, 0xb1f740b4
|
||||
};
|
||||
|
||||
/*
|
||||
@deftypefn Extension {unsigned int} crc32 (const unsigned char *@var{buf}, @
|
||||
int @var{len}, unsigned int @var{init})
|
||||
Compute the 32-bit CRC of @var{buf} which has length @var{len}. The
|
||||
starting value is 0xffffffff.
|
||||
This is used by the @command{gdb} remote protocol for the @samp{qCRC}
|
||||
command.
|
||||
This CRC can be specified as:
|
||||
Width : 32
|
||||
Poly : 0x04c11db7
|
||||
Init : 0xffffffff
|
||||
RefIn : false
|
||||
RefOut : false
|
||||
XorOut : 0
|
||||
This differs from the "standard" CRC-32 algorithm in that the values
|
||||
are not reflected, and there is no final XOR value. These differences
|
||||
make it easy to compose the values of multiple blocks.
|
||||
@end deftypefn
|
||||
*/
|
||||
|
||||
#include <stdint.h>
|
||||
|
||||
unsigned int
|
||||
xcrc32(const unsigned char *buf, int len)
|
||||
{
|
||||
uint32_t crc = 0xffffffff;
|
||||
while (len--) {
|
||||
crc = (crc << 8) ^ crc32_table[((crc >> 24) ^ *buf) & 255];
|
||||
buf++;
|
||||
}
|
||||
asm("mv a0, %0;"
|
||||
"ebreak;"
|
||||
:
|
||||
: "r"(crc));
|
||||
return crc;
|
||||
}
|
|
@ -1,33 +0,0 @@
|
|||
BIN2C = ../../../../src/helper/bin2char.sh
|
||||
|
||||
CROSS_COMPILE ?= arm-none-eabi-
|
||||
|
||||
CC=$(CROSS_COMPILE)gcc
|
||||
OBJCOPY=$(CROSS_COMPILE)objcopy
|
||||
OBJDUMP=$(CROSS_COMPILE)objdump
|
||||
|
||||
CFLAGS = -static -nostartfiles -mlittle-endian -Wa,-EL
|
||||
LDFLAGS = -Tdebug_handler.ld
|
||||
|
||||
all: debug_handler.inc
|
||||
|
||||
.PHONY: clean
|
||||
|
||||
.INTERMEDIATE: debug_handler.elf
|
||||
|
||||
debug_handler.elf: protocol.h
|
||||
|
||||
%.elf: %.S
|
||||
$(CC) $(CFLAGS) $(LDFLAGS) $< -o $@
|
||||
|
||||
%.lst: %.elf
|
||||
$(OBJDUMP) -S $< > $@
|
||||
|
||||
%.bin: %.elf
|
||||
$(OBJCOPY) -Obinary $< $@
|
||||
|
||||
%.inc: %.bin
|
||||
$(BIN2C) < $< > $@
|
||||
|
||||
clean:
|
||||
-rm -f *.elf *.lst *.bin *.inc
|
|
@ -1,101 +0,0 @@
|
|||
/* Autogenerated with ../../../../src/helper/bin2char.sh */
|
||||
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
|
||||
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
|
||||
0x10,0xde,0x1a,0xee,0x02,0xd1,0x1d,0xe2,0x01,0x00,0x00,0x1a,0x03,0xd1,0xa0,0xe3,
|
||||
0x10,0xde,0x0a,0xee,0x10,0xfe,0x1e,0xee,0xfd,0xff,0xff,0x6a,0x10,0x0e,0x08,0xee,
|
||||
0x10,0xfe,0x1e,0xee,0xfd,0xff,0xff,0x6a,0x10,0xee,0x08,0xee,0x01,0x00,0xa0,0xe1,
|
||||
0x70,0x01,0x00,0xeb,0x02,0x00,0xa0,0xe1,0x6e,0x01,0x00,0xeb,0x03,0x00,0xa0,0xe1,
|
||||
0x6c,0x01,0x00,0xeb,0x04,0x00,0xa0,0xe1,0x6a,0x01,0x00,0xeb,0x05,0x00,0xa0,0xe1,
|
||||
0x68,0x01,0x00,0xeb,0x06,0x00,0xa0,0xe1,0x66,0x01,0x00,0xeb,0x07,0x00,0xa0,0xe1,
|
||||
0x64,0x01,0x00,0xeb,0x00,0x00,0x4f,0xe1,0x62,0x01,0x00,0xeb,0x00,0x00,0x4f,0xe1,
|
||||
0x20,0x00,0xc0,0xe3,0xc0,0x00,0x80,0xe3,0x1f,0x10,0x00,0xe2,0x10,0x00,0x51,0xe3,
|
||||
0x01,0x00,0x00,0x1a,0x1f,0x00,0xc0,0xe3,0x1f,0x00,0x80,0xe3,0x3d,0x00,0x00,0xea,
|
||||
0x5c,0x01,0x00,0xeb,0x00,0x00,0x50,0xe3,0x39,0x00,0x00,0x0a,0x01,0x00,0x50,0xe3,
|
||||
0x5a,0x00,0x00,0x0a,0x11,0x00,0x50,0xe3,0x7b,0x00,0x00,0x0a,0x12,0x00,0x50,0xe3,
|
||||
0x83,0x00,0x00,0x0a,0x14,0x00,0x50,0xe3,0x8b,0x00,0x00,0x0a,0x21,0x00,0x50,0xe3,
|
||||
0x93,0x00,0x00,0x0a,0x22,0x00,0x50,0xe3,0x9b,0x00,0x00,0x0a,0x24,0x00,0x50,0xe3,
|
||||
0xa3,0x00,0x00,0x0a,0x30,0x00,0x50,0xe3,0x14,0x00,0x00,0x0a,0x31,0x00,0x50,0xe3,
|
||||
0x2b,0x01,0x00,0x0a,0x40,0x00,0x50,0xe3,0xc4,0x00,0x00,0x0a,0x41,0x00,0x50,0xe3,
|
||||
0xed,0x00,0x00,0x0a,0x50,0x00,0x50,0xe3,0xa7,0x00,0x00,0x0a,0x51,0x00,0x50,0xe3,
|
||||
0xac,0x00,0x00,0x0a,0x52,0x00,0x50,0xe3,0xac,0x00,0x00,0x0a,0x53,0x00,0x50,0xe3,
|
||||
0xac,0x00,0x00,0x0a,0x60,0x00,0x50,0xe3,0x9b,0x00,0x00,0x0a,0x61,0x00,0x50,0xe3,
|
||||
0x0c,0x01,0x00,0x0a,0x62,0x00,0x50,0xe3,0x14,0x01,0x00,0x0a,0xd7,0xff,0xff,0xea,
|
||||
0x34,0x01,0x00,0xeb,0x00,0xf0,0x69,0xe1,0x32,0x01,0x00,0xeb,0x00,0x70,0xa0,0xe1,
|
||||
0x30,0x01,0x00,0xeb,0x00,0x60,0xa0,0xe1,0x2e,0x01,0x00,0xeb,0x00,0x50,0xa0,0xe1,
|
||||
0x2c,0x01,0x00,0xeb,0x00,0x40,0xa0,0xe1,0x2a,0x01,0x00,0xeb,0x00,0x30,0xa0,0xe1,
|
||||
0x28,0x01,0x00,0xeb,0x00,0x20,0xa0,0xe1,0x26,0x01,0x00,0xeb,0x00,0x10,0xa0,0xe1,
|
||||
0x24,0x01,0x00,0xeb,0x10,0xfe,0x1e,0xee,0xfd,0xff,0xff,0x5a,0x10,0xee,0x19,0xee,
|
||||
0x00,0xf0,0x5e,0xe2,0x1f,0x01,0x00,0xeb,0x00,0x70,0x0f,0xe1,0x00,0xf0,0x21,0xe1,
|
||||
0x00,0x00,0xa0,0xe1,0x1f,0x10,0x00,0xe2,0x10,0xfe,0x1e,0xee,0xfd,0xff,0xff,0x6a,
|
||||
0x10,0x8e,0x08,0xee,0x10,0xfe,0x1e,0xee,0xfd,0xff,0xff,0x6a,0x10,0x9e,0x08,0xee,
|
||||
0x10,0xfe,0x1e,0xee,0xfd,0xff,0xff,0x6a,0x10,0xae,0x08,0xee,0x10,0xfe,0x1e,0xee,
|
||||
0xfd,0xff,0xff,0x6a,0x10,0xbe,0x08,0xee,0x10,0xfe,0x1e,0xee,0xfd,0xff,0xff,0x6a,
|
||||
0x10,0xce,0x08,0xee,0x10,0xfe,0x1e,0xee,0xfd,0xff,0xff,0x6a,0x10,0xde,0x08,0xee,
|
||||
0x10,0xfe,0x1e,0xee,0xfd,0xff,0xff,0x6a,0x10,0xee,0x08,0xee,0x1f,0x00,0x51,0xe3,
|
||||
0x03,0x00,0x00,0x0a,0x00,0x00,0x4f,0xe1,0x10,0xfe,0x1e,0xee,0xfd,0xff,0xff,0x6a,
|
||||
0x10,0x0e,0x08,0xee,0x07,0xf0,0x21,0xe1,0x00,0x00,0xa0,0xe1,0x9f,0xff,0xff,0xea,
|
||||
0xfc,0x00,0x00,0xeb,0x00,0x70,0x0f,0xe1,0x00,0xf0,0x21,0xe1,0x00,0x00,0xa0,0xe1,
|
||||
0x1f,0x10,0x00,0xe2,0x10,0xfe,0x1e,0xee,0xfd,0xff,0xff,0x5a,0x10,0x8e,0x19,0xee,
|
||||
0x10,0xfe,0x1e,0xee,0xfd,0xff,0xff,0x5a,0x10,0x9e,0x19,0xee,0x10,0xfe,0x1e,0xee,
|
||||
0xfd,0xff,0xff,0x5a,0x10,0xae,0x19,0xee,0x10,0xfe,0x1e,0xee,0xfd,0xff,0xff,0x5a,
|
||||
0x10,0xbe,0x19,0xee,0x10,0xfe,0x1e,0xee,0xfd,0xff,0xff,0x5a,0x10,0xce,0x19,0xee,
|
||||
0x10,0xfe,0x1e,0xee,0xfd,0xff,0xff,0x5a,0x10,0xde,0x19,0xee,0x10,0xfe,0x1e,0xee,
|
||||
0xfd,0xff,0xff,0x5a,0x10,0xee,0x19,0xee,0x1f,0x00,0x51,0xe3,0x03,0x00,0x00,0x0a,
|
||||
0x10,0xfe,0x1e,0xee,0xfd,0xff,0xff,0x5a,0x10,0x0e,0x19,0xee,0x00,0xf0,0x69,0xe1,
|
||||
0x07,0xf0,0x21,0xe1,0x00,0x00,0xa0,0xe1,0x7c,0xff,0xff,0xea,0xd9,0x00,0x00,0xeb,
|
||||
0x00,0x20,0xa0,0xe1,0xd7,0x00,0x00,0xeb,0x00,0x10,0xa0,0xe1,0x01,0x00,0xd2,0xe4,
|
||||
0x9a,0x8f,0x07,0xee,0xcf,0x00,0x00,0xeb,0x01,0x10,0x51,0xe2,0xfa,0xff,0xff,0x1a,
|
||||
0x72,0xff,0xff,0xea,0xcf,0x00,0x00,0xeb,0x00,0x20,0xa0,0xe1,0xcd,0x00,0x00,0xeb,
|
||||
0x00,0x10,0xa0,0xe1,0xb2,0x00,0xd2,0xe0,0x9a,0x8f,0x07,0xee,0xc5,0x00,0x00,0xeb,
|
||||
0x01,0x10,0x51,0xe2,0xfa,0xff,0xff,0x1a,0x68,0xff,0xff,0xea,0xc5,0x00,0x00,0xeb,
|
||||
0x00,0x20,0xa0,0xe1,0xc3,0x00,0x00,0xeb,0x00,0x10,0xa0,0xe1,0x04,0x00,0x92,0xe4,
|
||||
0x9a,0x8f,0x07,0xee,0xbb,0x00,0x00,0xeb,0x01,0x10,0x51,0xe2,0xfa,0xff,0xff,0x1a,
|
||||
0x5e,0xff,0xff,0xea,0xbb,0x00,0x00,0xeb,0x00,0x20,0xa0,0xe1,0xb9,0x00,0x00,0xeb,
|
||||
0x00,0x10,0xa0,0xe1,0xb7,0x00,0x00,0xeb,0x01,0x00,0xc2,0xe4,0x9a,0x8f,0x07,0xee,
|
||||
0x01,0x10,0x51,0xe2,0xfa,0xff,0xff,0x1a,0x54,0xff,0xff,0xea,0xb1,0x00,0x00,0xeb,
|
||||
0x00,0x20,0xa0,0xe1,0xaf,0x00,0x00,0xeb,0x00,0x10,0xa0,0xe1,0xad,0x00,0x00,0xeb,
|
||||
0xb2,0x00,0xc2,0xe0,0x9a,0x8f,0x07,0xee,0x01,0x10,0x51,0xe2,0xfa,0xff,0xff,0x1a,
|
||||
0x4a,0xff,0xff,0xea,0xa7,0x00,0x00,0xeb,0x00,0x20,0xa0,0xe1,0xa5,0x00,0x00,0xeb,
|
||||
0x00,0x10,0xa0,0xe1,0xa3,0x00,0x00,0xeb,0x04,0x00,0x82,0xe4,0x9a,0x8f,0x07,0xee,
|
||||
0x01,0x10,0x51,0xe2,0xfa,0xff,0xff,0x1a,0x40,0xff,0xff,0xea,0x10,0x0e,0x1a,0xee,
|
||||
0x20,0x00,0xc0,0xe3,0x10,0x0e,0x0a,0xee,0x3c,0xff,0xff,0xea,0x99,0x00,0x00,0xeb,
|
||||
0x01,0x1b,0xa0,0xe3,0xb2,0x0f,0x07,0xee,0x20,0x00,0x80,0xe2,0x01,0x10,0x51,0xe2,
|
||||
0xfb,0xff,0xff,0x1a,0x35,0xff,0xff,0xea,0x16,0x0f,0x07,0xee,0x33,0xff,0xff,0xea,
|
||||
0x15,0x0f,0x07,0xee,0x31,0xff,0xff,0xea,0x10,0x0f,0x12,0xee,0x00,0x00,0xa0,0xe1,
|
||||
0x04,0xf0,0x4f,0xe2,0x2d,0xff,0xff,0xea,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
|
||||
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
|
||||
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
|
||||
0x80,0x00,0x00,0xeb,0x00,0x10,0x8f,0xe2,0x80,0xf1,0x81,0xe0,0x10,0x0f,0x10,0xee,
|
||||
0x23,0x00,0x00,0xea,0x30,0x0f,0x10,0xee,0x21,0x00,0x00,0xea,0x10,0x0f,0x11,0xee,
|
||||
0x1f,0x00,0x00,0xea,0x30,0x0f,0x11,0xee,0x1d,0x00,0x00,0xea,0x10,0x0f,0x12,0xee,
|
||||
0x1b,0x00,0x00,0xea,0x10,0x0f,0x13,0xee,0x19,0x00,0x00,0xea,0x10,0x0f,0x15,0xee,
|
||||
0x17,0x00,0x00,0xea,0x10,0x0f,0x16,0xee,0x15,0x00,0x00,0xea,0x10,0x0f,0x1d,0xee,
|
||||
0x13,0x00,0x00,0xea,0x10,0x0f,0x1f,0xee,0x11,0x00,0x00,0xea,0x18,0x0f,0x1e,0xee,
|
||||
0x0f,0x00,0x00,0xea,0x19,0x0f,0x1e,0xee,0x0d,0x00,0x00,0xea,0x10,0x0f,0x1e,0xee,
|
||||
0x0b,0x00,0x00,0xea,0x13,0x0f,0x1e,0xee,0x09,0x00,0x00,0xea,0x14,0x0f,0x1e,0xee,
|
||||
0x07,0x00,0x00,0xea,0x10,0x0e,0x1b,0xee,0x05,0x00,0x00,0xea,0x10,0x0e,0x1c,0xee,
|
||||
0x03,0x00,0x00,0xea,0x10,0x0e,0x1d,0xee,0x01,0x00,0x00,0xea,0x10,0x0e,0x1a,0xee,
|
||||
0xff,0xff,0xff,0xea,0x53,0x00,0x00,0xeb,0xf8,0xfe,0xff,0xea,0x55,0x00,0x00,0xeb,
|
||||
0x00,0x10,0xa0,0xe1,0x53,0x00,0x00,0xeb,0x00,0x20,0x8f,0xe2,0x81,0xf1,0x82,0xe0,
|
||||
0x10,0x0f,0x00,0xee,0xf1,0xfe,0xff,0xea,0x30,0x0f,0x00,0xee,0xef,0xfe,0xff,0xea,
|
||||
0x10,0x0f,0x01,0xee,0xed,0xfe,0xff,0xea,0x30,0x0f,0x01,0xee,0xeb,0xfe,0xff,0xea,
|
||||
0x10,0x0f,0x02,0xee,0xe9,0xfe,0xff,0xea,0x10,0x0f,0x03,0xee,0xe7,0xfe,0xff,0xea,
|
||||
0x10,0x0f,0x05,0xee,0xe5,0xfe,0xff,0xea,0x10,0x0f,0x06,0xee,0xe3,0xfe,0xff,0xea,
|
||||
0x10,0x0f,0x0d,0xee,0xe1,0xfe,0xff,0xea,0x10,0x0f,0x0f,0xee,0xdf,0xfe,0xff,0xea,
|
||||
0x18,0x0f,0x0e,0xee,0xdd,0xfe,0xff,0xea,0x19,0x0f,0x0e,0xee,0xdb,0xfe,0xff,0xea,
|
||||
0x10,0x0f,0x0e,0xee,0xd9,0xfe,0xff,0xea,0x13,0x0f,0x0e,0xee,0xd7,0xfe,0xff,0xea,
|
||||
0x14,0x0f,0x0e,0xee,0xd5,0xfe,0xff,0xea,0x10,0x0e,0x0b,0xee,0xd3,0xfe,0xff,0xea,
|
||||
0x10,0x0e,0x0c,0xee,0xd1,0xfe,0xff,0xea,0x10,0x0e,0x0d,0xee,0xcf,0xfe,0xff,0xea,
|
||||
0x10,0x0e,0x0a,0xee,0xcd,0xfe,0xff,0xea,0x01,0x1c,0xa0,0xe3,0x10,0x0e,0x1b,0xee,
|
||||
0x24,0x00,0x00,0xeb,0x01,0x10,0x51,0xe2,0xfb,0xff,0xff,0x1a,0x10,0x0e,0x1c,0xee,
|
||||
0x20,0x00,0x00,0xeb,0x10,0x0e,0x1d,0xee,0x1e,0x00,0x00,0xeb,0xc3,0xfe,0xff,0xea,
|
||||
0x01,0x1c,0xa0,0xe3,0x10,0x0e,0x1b,0xee,0x01,0x10,0x51,0xe2,0xfc,0xff,0xff,0x1a,
|
||||
0xbe,0xfe,0xff,0xea,0x1b,0x00,0x00,0xeb,0x00,0xf0,0x69,0xe1,0x19,0x00,0x00,0xeb,
|
||||
0x00,0x70,0xa0,0xe1,0x17,0x00,0x00,0xeb,0x00,0x60,0xa0,0xe1,0x15,0x00,0x00,0xeb,
|
||||
0x00,0x50,0xa0,0xe1,0x13,0x00,0x00,0xeb,0x00,0x40,0xa0,0xe1,0x11,0x00,0x00,0xeb,
|
||||
0x00,0x30,0xa0,0xe1,0x0f,0x00,0x00,0xeb,0x00,0x20,0xa0,0xe1,0x0d,0x00,0x00,0xeb,
|
||||
0x00,0x10,0xa0,0xe1,0x0b,0x00,0x00,0xeb,0x10,0xfe,0x1e,0xee,0xfd,0xff,0xff,0x5a,
|
||||
0x10,0xee,0x19,0xee,0x10,0xde,0x1a,0xee,0x01,0xd0,0x8d,0xe3,0x10,0xde,0x0a,0xee,
|
||||
0x00,0xf0,0x5e,0xe2,0xfe,0xff,0xff,0xea,0x10,0xfe,0x1e,0xee,0xfd,0xff,0xff,0x6a,
|
||||
0x10,0x0e,0x08,0xee,0x0e,0xf0,0xa0,0xe1,0x10,0xfe,0x1e,0xee,0xfd,0xff,0xff,0x5a,
|
||||
0x10,0x0e,0x19,0xee,0x0e,0xf0,0xa0,0xe1,
|
|
@ -1,47 +0,0 @@
|
|||
BIN2C = ../../../src/helper/bin2char.sh
|
||||
|
||||
ARM_CROSS_COMPILE ?= arm-none-eabi-
|
||||
ARM_AS ?= $(ARM_CROSS_COMPILE)as
|
||||
ARM_OBJCOPY ?= $(ARM_CROSS_COMPILE)objcopy
|
||||
|
||||
ARM_AFLAGS = -EL
|
||||
|
||||
STM8_CROSS_COMPILE ?= stm8-
|
||||
STM8_AS ?= $(STM8_CROSS_COMPILE)as
|
||||
STM8_OBJCOPY ?= $(STM8_CROSS_COMPILE)objcopy
|
||||
|
||||
STM8_AFLAGS =
|
||||
|
||||
arm: armv4_5_erase_check.inc armv7m_erase_check.inc
|
||||
|
||||
armv4_5_%.elf: armv4_5_%.s
|
||||
$(ARM_AS) $(ARM_AFLAGS) $< -o $@
|
||||
|
||||
armv4_5_%.bin: armv4_5_%.elf
|
||||
$(ARM_OBJCOPY) -Obinary $< $@
|
||||
|
||||
armv4_5_%.inc: armv4_5_%.bin
|
||||
$(BIN2C) < $< > $@
|
||||
|
||||
armv7m_%.elf: armv7m_%.s
|
||||
$(ARM_AS) $(ARM_AFLAGS) $< -o $@
|
||||
|
||||
armv7m_%.bin: armv7m_%.elf
|
||||
$(ARM_OBJCOPY) -Obinary $< $@
|
||||
|
||||
armv7m_%.inc: armv7m_%.bin
|
||||
$(BIN2C) < $< > $@
|
||||
|
||||
stm8: stm8_erase_check.inc
|
||||
|
||||
stm8_%.elf: stm8_%.s
|
||||
$(STM8_AS) $(STM8_AFLAGS) $< -o $@
|
||||
|
||||
stm8_%.bin: stm8_%.elf
|
||||
$(STM8_OBJCOPY) -Obinary $< $@
|
||||
|
||||
stm8_%.inc: stm8_%.bin
|
||||
$(BIN2C) < $< > $@
|
||||
|
||||
clean:
|
||||
-rm -f *.elf *.bin *.inc
|
|
@ -1,3 +0,0 @@
|
|||
/* Autogenerated with ../../../src/helper/bin2char.sh */
|
||||
0x01,0x30,0xd0,0xe4,0x03,0x20,0x02,0xe0,0x01,0x10,0x51,0xe2,0xfb,0xff,0xff,0x1a,
|
||||
0x70,0x00,0x20,0xe1,
|
|
@ -15,7 +15,7 @@
|
|||
* You should have received a copy of the GNU General Public License *
|
||||
* along with this program; if not, write to the *
|
||||
* Free Software Foundation, Inc., *
|
||||
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. *
|
||||
* 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. *
|
||||
***************************************************************************/
|
||||
|
||||
/*
|
||||
|
@ -36,4 +36,6 @@ loop:
|
|||
end:
|
||||
bkpt #0
|
||||
|
||||
CRC32XOR: .word 0x04c11db7
|
||||
|
||||
.end
|
||||
|
|
|
@ -1,4 +0,0 @@
|
|||
/* Autogenerated with ../../../src/helper/bin2char.sh */
|
||||
0x02,0x68,0x12,0x42,0x0d,0xd0,0x43,0x68,0x1c,0x68,0x04,0x33,0x8c,0x42,0x05,0xd1,
|
||||
0x01,0x3a,0xf9,0xd1,0x01,0x24,0x04,0x60,0x08,0x30,0xf1,0xe7,0x00,0x24,0xfa,0xe7,
|
||||
0x00,0x00,0x00,0xbe,
|
|
@ -15,13 +15,14 @@
|
|||
* You should have received a copy of the GNU General Public License *
|
||||
* along with this program; if not, write to the *
|
||||
* Free Software Foundation, Inc., *
|
||||
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. *
|
||||
* 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. *
|
||||
***************************************************************************/
|
||||
|
||||
/*
|
||||
parameters:
|
||||
r0 - pointer to struct { uint32_t size_in_result_out, uint32_t addr }
|
||||
r1 - value to check
|
||||
r0 - address in
|
||||
r1 - byte count
|
||||
r2 - mask - result out
|
||||
*/
|
||||
|
||||
.text
|
||||
|
@ -32,42 +33,13 @@
|
|||
|
||||
.align 2
|
||||
|
||||
BLOCK_SIZE_RESULT = 0
|
||||
BLOCK_ADDRESS = 4
|
||||
SIZEOF_STRUCT_BLOCK = 8
|
||||
|
||||
start:
|
||||
block_loop:
|
||||
ldr r2, [r0, #BLOCK_SIZE_RESULT] /* get size */
|
||||
tst r2, r2
|
||||
beq done
|
||||
|
||||
ldr r3, [r0, #BLOCK_ADDRESS] /* get address */
|
||||
|
||||
word_loop:
|
||||
ldr r4, [r3] /* read word */
|
||||
adds r3, #4
|
||||
|
||||
cmp r4, r1
|
||||
bne not_erased
|
||||
|
||||
subs r2, #1
|
||||
bne word_loop
|
||||
|
||||
movs r4, #1 /* block is erased */
|
||||
save_result:
|
||||
str r4, [r0, #BLOCK_SIZE_RESULT]
|
||||
adds r0, #SIZEOF_STRUCT_BLOCK
|
||||
b block_loop
|
||||
|
||||
not_erased:
|
||||
movs r4, #0
|
||||
b save_result
|
||||
|
||||
/* Avoid padding at .text segment end. Otherwise exit point check fails. */
|
||||
.skip ( . - start + 2) & 2, 0
|
||||
|
||||
done:
|
||||
loop:
|
||||
ldrb r3, [r0]
|
||||
adds r0, #1
|
||||
ands r2, r2, r3
|
||||
subs r1, r1, #1
|
||||
bne loop
|
||||
end:
|
||||
bkpt #0
|
||||
|
||||
.end
|
||||
|
|
|
@ -1,5 +0,0 @@
|
|||
/* Autogenerated with ../../../src/helper/bin2char.sh */
|
||||
0x00,0x80,0x00,0x00,0x80,0x00,0x96,0xcf,0x00,0x22,0x1e,0x01,0x16,0x04,0xa6,0xff,
|
||||
0x90,0x5d,0x26,0x04,0x0d,0x03,0x27,0x17,0x90,0x5d,0x26,0x02,0x0a,0x03,0x90,0x5a,
|
||||
0x92,0xbc,0x00,0x00,0xa1,0xff,0x26,0x07,0x5c,0x26,0xe5,0x0c,0x00,0x20,0xe1,0x1f,
|
||||
0x01,0x17,0x04,0x8b,
|
|
@ -1,69 +0,0 @@
|
|||
/*
|
||||
* Copyright (C) 2017 Ake Rehnman
|
||||
* ake.rehnman(at)gmail.com
|
||||
*
|
||||
* This program is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation, either version 2 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, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
;;
|
||||
;; erase check memory code
|
||||
;;
|
||||
.org 0x0
|
||||
;; start address
|
||||
start_addr: .byte 0x00
|
||||
.word 0x8000
|
||||
;; byte count
|
||||
byte_cnt: .byte 0x00
|
||||
.word 0x8000
|
||||
;
|
||||
; SP must point to start_addr on entry
|
||||
; first relocate start_addr to the location
|
||||
; we are running at
|
||||
start:
|
||||
ldw X,SP
|
||||
ldw .cont+2,X
|
||||
ldw X,(start_addr+1,SP) ;start addr
|
||||
ldw Y,(byte_cnt+1,SP) ;count
|
||||
ld A,#0xff
|
||||
;
|
||||
; if count == 0 return
|
||||
.L1:
|
||||
tnzw Y
|
||||
jrne .decrcnt ;continue if low word != 0
|
||||
tnz (byte_cnt,SP) ;high byte
|
||||
jreq .exit ;goto exit
|
||||
;
|
||||
; decrement count (byte_cnt)
|
||||
.decrcnt:
|
||||
tnzw Y ;low word count
|
||||
jrne .decr1
|
||||
dec (byte_cnt,SP) ;high byte
|
||||
.decr1:
|
||||
decw Y; decr low word
|
||||
;
|
||||
; first check if [start_addr] is 0xff
|
||||
.cont:
|
||||
ldf A, [start_addr.e]
|
||||
cp A,#0xff
|
||||
jrne .exit ;exit if not 0xff
|
||||
;
|
||||
; increment start_addr (addr)
|
||||
incw X
|
||||
jrne .L1
|
||||
inc (start_addr,SP) ;increment high byte
|
||||
jra .L1
|
||||
;
|
||||
.exit:
|
||||
ldw (start_addr+1,SP),X ;start addr
|
||||
ldw (byte_cnt+1,SP),Y ;count
|
||||
break
|
|
@ -17,7 +17,7 @@
|
|||
* You should have received a copy of the GNU General Public License *
|
||||
* along with this program; if not, write to the *
|
||||
* Free Software Foundation, Inc., *
|
||||
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. *
|
||||
* 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. *
|
||||
***************************************************************************/
|
||||
|
||||
.text
|
||||
|
|
|
@ -17,7 +17,7 @@
|
|||
* You should have received a copy of the GNU General Public License *
|
||||
* along with this program; if not, write to the *
|
||||
* Free Software Foundation, Inc., *
|
||||
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. *
|
||||
* 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. *
|
||||
***************************************************************************/
|
||||
|
||||
.text
|
||||
|
|
|
@ -17,7 +17,7 @@
|
|||
* You should have received a copy of the GNU General Public License *
|
||||
* along with this program; if not, write to the *
|
||||
* Free Software Foundation, Inc., *
|
||||
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. *
|
||||
* 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. *
|
||||
***************************************************************************/
|
||||
|
||||
.text
|
||||
|
|
|
@ -17,7 +17,7 @@
|
|||
* You should have received a copy of the GNU General Public License *
|
||||
* along with this program; if not, write to the *
|
||||
* Free Software Foundation, Inc., *
|
||||
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. *
|
||||
* 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. *
|
||||
***************************************************************************/
|
||||
|
||||
.text
|
||||
|
|
|
@ -17,7 +17,7 @@
|
|||
* You should have received a copy of the GNU General Public License *
|
||||
* along with this program; if not, write to the *
|
||||
* Free Software Foundation, Inc., *
|
||||
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. *
|
||||
* 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. *
|
||||
***************************************************************************/
|
||||
|
||||
.text
|
||||
|
|
|
@ -17,7 +17,7 @@
|
|||
* You should have received a copy of the GNU General Public License *
|
||||
* along with this program; if not, write to the *
|
||||
* Free Software Foundation, Inc., *
|
||||
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. *
|
||||
* 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. *
|
||||
***************************************************************************/
|
||||
|
||||
.text
|
||||
|
|
|
@ -17,13 +17,13 @@
|
|||
* You should have received a copy of the GNU General Public License *
|
||||
* along with this program; if not, write to the *
|
||||
* Free Software Foundation, Inc., *
|
||||
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. *
|
||||
* 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. *
|
||||
***************************************************************************/
|
||||
|
||||
.text
|
||||
.arm
|
||||
.arch armv4
|
||||
|
||||
|
||||
.section .init
|
||||
|
||||
/* input parameters - */
|
||||
|
|
|
@ -17,7 +17,7 @@
|
|||
* You should have received a copy of the GNU General Public License *
|
||||
* along with this program; if not, write to the *
|
||||
* Free Software Foundation, Inc., *
|
||||
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. *
|
||||
* 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. *
|
||||
***************************************************************************/
|
||||
|
||||
.text
|
||||
|
|
|
@ -1,27 +0,0 @@
|
|||
BIN2C = ../../../../src/helper/bin2char.sh
|
||||
|
||||
CROSS_COMPILE ?= arm-none-eabi-
|
||||
|
||||
CC=$(CROSS_COMPILE)gcc
|
||||
OBJCOPY=$(CROSS_COMPILE)objcopy
|
||||
OBJDUMP=$(CROSS_COMPILE)objdump
|
||||
|
||||
CFLAGS = -c -mthumb -mcpu=cortex-m0 -O3 -g
|
||||
|
||||
all: bluenrg-x_write.inc
|
||||
|
||||
.PHONY: clean
|
||||
|
||||
.INTERMEDIATE: bluenrg-x_write.o
|
||||
|
||||
%.o: %.c
|
||||
$(CC) $(CFLAGS) -Wall -Wextra -Wa,-adhln=$*.lst $< -o $@
|
||||
|
||||
%.bin: %.o
|
||||
$(OBJCOPY) -Obinary $< $@
|
||||
|
||||
%.inc: %.bin
|
||||
$(BIN2C) < $< > $@
|
||||
|
||||
clean:
|
||||
-rm -f *.o *.lst *.bin *.inc
|
|
@ -1,113 +0,0 @@
|
|||
/* To be built with arm-none-eabi-gcc -c -mthumb -mcpu=cortex-m0 -O3 bluenrgx.c */
|
||||
/* Then postprocess output of command "arm-none-eabi-objdump -d bluenrgx.o" to make a C array of bytes */
|
||||
|
||||
#include <stdint.h>
|
||||
#include "../../../../src/flash/nor/bluenrg-x.h"
|
||||
|
||||
/* Status Values ----------------------------------------------------------*/
|
||||
#define SUCCESS 0
|
||||
#define ERR_UNALIGNED 1
|
||||
#define ERR_INVALID_ADDRESS 2
|
||||
#define ERR_INVALID_TYPE 3
|
||||
#define ERR_WRITE_PROTECTED 4
|
||||
#define ERR_WRITE_FAILED 5
|
||||
#define ERR_ERASE_REQUIRED 6
|
||||
#define ERR_VERIFY_FAILED 7
|
||||
|
||||
#define MFB_MASS_ERASE 0x01
|
||||
#define MFB_PAGE_ERASE 0x02
|
||||
|
||||
#define DO_ERASE 0x0100
|
||||
#define DO_VERIFY 0x0200
|
||||
|
||||
#define MFB_BOTTOM (0x10040000)
|
||||
#define MFB_SIZE_B(regs_base) ((16 * (((*(volatile uint32_t *)(regs_base + FLASH_SIZE_REG)) + 1) >> 12)) * 1024)
|
||||
#define MFB_SIZE_W (MFB_SIZE_B/4)
|
||||
#define MFB_TOP (MFB_BOTTOM+MFB_SIZE_B-1)
|
||||
#define MFB_PAGE_SIZE_B (2048)
|
||||
#define MFB_PAGE_SIZE_W (MFB_PAGE_SIZE_B/4)
|
||||
|
||||
#define AREA_ERROR 0x01
|
||||
#define AREA_MFB 0x04
|
||||
|
||||
typedef struct {
|
||||
volatile uint8_t *wp;
|
||||
uint8_t *rp;
|
||||
} work_area_t;
|
||||
|
||||
/* Flash Commands --------------------------------------------------------*/
|
||||
static inline __attribute__((always_inline)) uint32_t flashWrite(uint32_t address, uint8_t **data,
|
||||
uint32_t writeLength, uint32_t flash_regs_base)
|
||||
{
|
||||
uint32_t index, flash_word[4];
|
||||
uint8_t i;
|
||||
|
||||
*((volatile uint32_t *)(flash_regs_base + FLASH_REG_IRQMASK)) = 0;
|
||||
for (index = 0; index < writeLength; index += (FLASH_WORD_LEN*4)) {
|
||||
for (i = 0; i < 4; i++)
|
||||
flash_word[i] = (*(uint32_t *) (*data + i*4));
|
||||
|
||||
/* Clear the IRQ flags */
|
||||
*((volatile uint32_t *)(flash_regs_base + FLASH_REG_IRQRAW)) = 0x0000003F;
|
||||
/* Load the flash address to write */
|
||||
*((volatile uint32_t *)(flash_regs_base + FLASH_REG_ADDRESS)) = (uint16_t)((address + index - MFB_BOTTOM) >> 2);
|
||||
/* Prepare and load the data to flash */
|
||||
*((volatile uint32_t *)(flash_regs_base + FLASH_REG_DATA0)) = flash_word[0];
|
||||
*((volatile uint32_t *)(flash_regs_base + FLASH_REG_DATA1)) = flash_word[1];
|
||||
*((volatile uint32_t *)(flash_regs_base + FLASH_REG_DATA2)) = flash_word[2];
|
||||
*((volatile uint32_t *)(flash_regs_base + FLASH_REG_DATA3)) = flash_word[3];
|
||||
/* Flash write command */
|
||||
*((volatile uint32_t *)(flash_regs_base + FLASH_REG_COMMAND)) = FLASH_CMD_BURSTWRITE;
|
||||
/* Wait the end of the flash write command */
|
||||
while ((*((volatile uint32_t *)(flash_regs_base + FLASH_REG_IRQRAW)) & FLASH_INT_CMDDONE) == 0)
|
||||
;
|
||||
*data += (FLASH_WORD_LEN * 4);
|
||||
}
|
||||
|
||||
return SUCCESS;
|
||||
}
|
||||
|
||||
__attribute__((naked)) __attribute__((noreturn)) void write(uint8_t *work_area_p,
|
||||
uint8_t *fifo_end,
|
||||
uint8_t *target_address,
|
||||
uint32_t count,
|
||||
uint32_t flash_regs_base)
|
||||
{
|
||||
uint32_t retval;
|
||||
volatile work_area_t *work_area = (work_area_t *) work_area_p;
|
||||
uint8_t *fifo_start = (uint8_t *) work_area->rp;
|
||||
|
||||
while (count) {
|
||||
volatile int32_t fifo_linear_size;
|
||||
|
||||
/* Wait for some data in the FIFO */
|
||||
while (work_area->rp == work_area->wp)
|
||||
;
|
||||
if (work_area->wp == 0) {
|
||||
/* Aborted by other party */
|
||||
break;
|
||||
}
|
||||
if (work_area->rp > work_area->wp) {
|
||||
fifo_linear_size = fifo_end-work_area->rp;
|
||||
} else {
|
||||
fifo_linear_size = (work_area->wp - work_area->rp);
|
||||
if (fifo_linear_size < 0)
|
||||
fifo_linear_size = 0;
|
||||
}
|
||||
if (fifo_linear_size < 16) {
|
||||
/* We should never get here */
|
||||
continue;
|
||||
}
|
||||
|
||||
retval = flashWrite((uint32_t) target_address, (uint8_t **) &work_area->rp, fifo_linear_size, flash_regs_base);
|
||||
if (retval != SUCCESS) {
|
||||
work_area->rp = (uint8_t *)retval;
|
||||
break;
|
||||
}
|
||||
target_address += fifo_linear_size;
|
||||
if (work_area->rp >= fifo_end)
|
||||
work_area->rp = fifo_start;
|
||||
count -= fifo_linear_size;
|
||||
}
|
||||
__asm("bkpt 0");
|
||||
}
|
|
@ -1,17 +0,0 @@
|
|||
/* Autogenerated with ../../../../src/helper/bin2char.sh */
|
||||
0x05,0x93,0x43,0x68,0x14,0x9e,0x09,0x93,0x05,0x9b,0x05,0x00,0x07,0x91,0x06,0x92,
|
||||
0x01,0x24,0xb1,0x46,0x00,0x2b,0x68,0xd0,0x6a,0x68,0x2b,0x68,0x9a,0x42,0xfb,0xd0,
|
||||
0x2b,0x68,0x00,0x2b,0x61,0xd0,0x6a,0x68,0x2b,0x68,0x9a,0x42,0x5e,0xd9,0x6b,0x68,
|
||||
0x07,0x9a,0xd3,0x1a,0x0f,0x2b,0xef,0xdd,0x4a,0x46,0x00,0x21,0x03,0x93,0xd1,0x60,
|
||||
0x00,0x2b,0x42,0xd0,0x40,0x22,0x4a,0x44,0x90,0x46,0x44,0x22,0x4a,0x44,0x00,0x92,
|
||||
0x48,0x22,0x4a,0x44,0x93,0x46,0x4c,0x22,0x27,0x4f,0x4a,0x44,0xbc,0x46,0x4e,0x46,
|
||||
0x92,0x46,0x06,0x99,0x4b,0x46,0x61,0x44,0x08,0x00,0x00,0x99,0x18,0x36,0x6a,0x68,
|
||||
0x08,0x95,0x8c,0x46,0x55,0x46,0xda,0x46,0xb3,0x46,0x10,0x33,0x04,0x92,0x11,0x68,
|
||||
0x5e,0x46,0x00,0x91,0x51,0x68,0x97,0x68,0x01,0x91,0xd1,0x68,0x02,0x91,0x3f,0x21,
|
||||
0x19,0x60,0x81,0x03,0x09,0x0c,0x31,0x60,0x46,0x46,0x00,0x99,0x31,0x60,0x66,0x46,
|
||||
0x01,0x99,0x31,0x60,0x56,0x46,0x02,0x99,0x37,0x60,0x29,0x60,0xcc,0x26,0x49,0x46,
|
||||
0x0e,0x60,0x19,0x68,0x0c,0x42,0xfc,0xd0,0x04,0x99,0x03,0x9e,0x10,0x32,0x10,0x30,
|
||||
0x51,0x1a,0x8e,0x42,0xdb,0xd8,0x08,0x9d,0x6a,0x60,0x03,0x9a,0x06,0x9b,0x94,0x46,
|
||||
0x63,0x44,0x06,0x93,0x07,0x9a,0x6b,0x68,0x9a,0x42,0x01,0xd8,0x09,0x9b,0x6b,0x60,
|
||||
0x05,0x9b,0x03,0x9a,0x9b,0x1a,0x05,0x93,0x96,0xd1,0x00,0xbe,0x2b,0x68,0x6a,0x68,
|
||||
0x9b,0x1a,0x9f,0xd5,0x90,0xe7,0xc0,0x46,0x00,0x00,0xfc,0xef,
|
|
@ -1,83 +0,0 @@
|
|||
BIN2C = ../../../../src/helper/bin2char.sh
|
||||
|
||||
CROSS_COMPILE ?= arm-none-eabi-
|
||||
GCC = $(CROSS_COMPILE)gcc
|
||||
OBJCOPY = $(CROSS_COMPILE)objcopy
|
||||
|
||||
FLAGS = -mthumb -Os -ffunction-sections -fdata-sections -g -gdwarf-3
|
||||
FLAGS += -gstrict-dwarf -Wall -fno-strict-aliasing --asm
|
||||
|
||||
CFLAGS = -c -I.
|
||||
|
||||
CC26X0_CFLAGS = -mcpu=cortex-m3 -DDEVICE_CC26X0
|
||||
|
||||
CC26X2_CFLAGS = -mcpu=cortex-m4 -DDEVICE_CC26X2
|
||||
|
||||
CC26X0_OBJS := \
|
||||
cc26x0/flashloader.o \
|
||||
cc26x0/main.o \
|
||||
cc26x0/startup.o \
|
||||
cc26x0/flash.o
|
||||
|
||||
CC26X2_OBJS := \
|
||||
cc26x2/flashloader.o \
|
||||
cc26x2/main.o \
|
||||
cc26x2/startup.o \
|
||||
cc26x2/flash.o
|
||||
|
||||
all: cc26x0_algo.inc cc26x2_algo.inc
|
||||
|
||||
cc26x0/%.o: %.c
|
||||
@echo 'Building file: $<'
|
||||
@echo 'Invoking: GNU Compiler'
|
||||
$(GCC) $(FLAGS) $(CFLAGS) $(CC26X0_CFLAGS) -o"$@" "$(shell echo $<)"
|
||||
@echo 'Finished building: $<'
|
||||
@echo ' '
|
||||
|
||||
cc26x2/%.o: %.c
|
||||
@echo 'Building file: $<'
|
||||
@echo 'Invoking: GNU Compiler'
|
||||
$(GCC) $(FLAGS) $(CFLAGS) $(CC26X2_CFLAGS) -o"$@" "$(shell echo $<)"
|
||||
@echo 'Finished building: $<'
|
||||
@echo ' '
|
||||
|
||||
cc26x0_algo.out: $(CC26X0_OBJS)
|
||||
@echo 'Building target: $@'
|
||||
@echo 'Invoking: GNU Linker'
|
||||
$(GCC) $(FLAGS) -o$@ $(CC26X0_OBJS) -Wl,-T"cc26x0/cc26x0r2f.lds"
|
||||
@echo 'Finished building target: $@'
|
||||
@echo ' '
|
||||
|
||||
cc26x2_algo.out: $(CC26X2_OBJS)
|
||||
@echo 'Building target: $@'
|
||||
@echo 'Invoking: GNU Linker'
|
||||
$(GCC) $(FLAGS) -o$@ $(CC26X2_OBJS) -Wl,-T"cc26x2/cc26x2r1f.lds"
|
||||
@echo 'Finished building target: $@'
|
||||
@echo ' '
|
||||
|
||||
%.bin: %.out
|
||||
@echo 'Building target: $@'
|
||||
@echo 'Invoking: GNU Objcopy Utility'
|
||||
$(OBJCOPY) -Obinary $< $@
|
||||
@echo 'Finished building target: $@'
|
||||
@echo ' '
|
||||
|
||||
%.inc: %.bin
|
||||
@echo 'Building target: $@'
|
||||
@echo 'Invoking Bin2Char Script'
|
||||
$(BIN2C) < $< > $@
|
||||
rm $< $*.out
|
||||
@echo 'Finished building target: $@'
|
||||
@echo ' '
|
||||
|
||||
clean:
|
||||
@echo 'Cleaning Targets and Build Artifacts'
|
||||
rm -rf *.inc *.bin *.out *.map
|
||||
rm -rf cc26x0/*.o cc26x0/*.d
|
||||
rm -rf cc26x2/*.o cc26x2/*.d
|
||||
@echo 'Finished clean'
|
||||
@echo ' '
|
||||
|
||||
.PRECIOUS: %.bin
|
||||
|
||||
.PHONY: all clean
|
|
@ -1,90 +0,0 @@
|
|||
/******************************************************************************
|
||||
*
|
||||
* Copyright (C) 2018 Texas Instruments Incorporated - http://www.ti.com/
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without
|
||||
* modification, are permitted provided that the following conditions
|
||||
* are met:
|
||||
*
|
||||
* Redistributions of source code must retain the above copyright
|
||||
* notice, this list of conditions and the following disclaimer.
|
||||
*
|
||||
* Redistributions in binary form must reproduce the above copyright
|
||||
* notice, this list of conditions and the following disclaimer in the
|
||||
* documentation and/or other materials provided with the
|
||||
* distribution.
|
||||
*
|
||||
* Neither the name of Texas Instruments Incorporated nor the names of
|
||||
* its contributors may be used to endorse or promote products derived
|
||||
* from this software without specific prior written permission.
|
||||
*
|
||||
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
|
||||
* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
|
||||
* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
|
||||
* A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
|
||||
* OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
|
||||
* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
|
||||
* LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
|
||||
* DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
|
||||
* THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
|
||||
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
|
||||
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
*
|
||||
******************************************************************************/
|
||||
|
||||
/* Entry Point */
|
||||
ENTRY( entry )
|
||||
|
||||
/* System memory map */
|
||||
MEMORY
|
||||
{
|
||||
/* Application is stored in and executes from SRAM */
|
||||
PROGRAM (RWX) : ORIGIN = 0x20000000, LENGTH = 0x1BD8
|
||||
BUFFERS (RWX) : ORIGIN = 0x20001BD8, LENGTH = 0x3028
|
||||
}
|
||||
|
||||
/* Section allocation in memory */
|
||||
SECTIONS
|
||||
{
|
||||
.text :
|
||||
{
|
||||
_text = .;
|
||||
*(.entry*)
|
||||
*(.text*)
|
||||
_etext = .;
|
||||
} > PROGRAM
|
||||
|
||||
.data :
|
||||
{ _data = .;
|
||||
*(.rodata*)
|
||||
*(.data*)
|
||||
_edata = .;
|
||||
}
|
||||
|
||||
.bss :
|
||||
{
|
||||
__bss_start__ = .;
|
||||
_bss = .;
|
||||
*(.bss*)
|
||||
*(COMMON)
|
||||
_ebss = .;
|
||||
__bss_end__ = .;
|
||||
} > PROGRAM
|
||||
|
||||
.stack :
|
||||
{
|
||||
_stack = .;
|
||||
*(.stack*)
|
||||
_estack = .;
|
||||
} > PROGRAM
|
||||
|
||||
.buffers :
|
||||
{
|
||||
_buffers = .;
|
||||
*(.buffers.g_cfg)
|
||||
*(.buffers.g_buf1)
|
||||
*(.buffers.g_buf2)
|
||||
*(.buffers*)
|
||||
_ebuffers = .;
|
||||
} > BUFFERS
|
||||
}
|
File diff suppressed because it is too large
Load Diff
|
@ -1,90 +0,0 @@
|
|||
/******************************************************************************
|
||||
*
|
||||
* Copyright (C) 2018 Texas Instruments Incorporated - http://www.ti.com/
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without
|
||||
* modification, are permitted provided that the following conditions
|
||||
* are met:
|
||||
*
|
||||
* Redistributions of source code must retain the above copyright
|
||||
* notice, this list of conditions and the following disclaimer.
|
||||
*
|
||||
* Redistributions in binary form must reproduce the above copyright
|
||||
* notice, this list of conditions and the following disclaimer in the
|
||||
* documentation and/or other materials provided with the
|
||||
* distribution.
|
||||
*
|
||||
* Neither the name of Texas Instruments Incorporated nor the names of
|
||||
* its contributors may be used to endorse or promote products derived
|
||||
* from this software without specific prior written permission.
|
||||
*
|
||||
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
|
||||
* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
|
||||
* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
|
||||
* A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
|
||||
* OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
|
||||
* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
|
||||
* LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
|
||||
* DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
|
||||
* THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
|
||||
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
|
||||
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
*
|
||||
******************************************************************************/
|
||||
|
||||
/* Entry Point */
|
||||
ENTRY( entry )
|
||||
|
||||
/* System memory map */
|
||||
MEMORY
|
||||
{
|
||||
/* Application is stored in and executes from SRAM */
|
||||
PROGRAM (RWX) : ORIGIN = 0x20000000, LENGTH = 0x1FD8
|
||||
BUFFERS (RWX) : ORIGIN = 0x20001FD8, LENGTH = 0x6028
|
||||
}
|
||||
|
||||
/* Section allocation in memory */
|
||||
SECTIONS
|
||||
{
|
||||
.text :
|
||||
{
|
||||
_text = .;
|
||||
*(.entry*)
|
||||
*(.text*)
|
||||
_etext = .;
|
||||
} > PROGRAM
|
||||
|
||||
.data :
|
||||
{ _data = .;
|
||||
*(.rodata*)
|
||||
*(.data*)
|
||||
_edata = .;
|
||||
}
|
||||
|
||||
.bss :
|
||||
{
|
||||
__bss_start__ = .;
|
||||
_bss = .;
|
||||
*(.bss*)
|
||||
*(COMMON)
|
||||
_ebss = .;
|
||||
__bss_end__ = .;
|
||||
} > PROGRAM
|
||||
|
||||
.stack :
|
||||
{
|
||||
_stack = .;
|
||||
*(.stack*)
|
||||
_estack = .;
|
||||
} > PROGRAM
|
||||
|
||||
.buffers :
|
||||
{
|
||||
_buffers = .;
|
||||
*(.buffers.g_cfg)
|
||||
*(.buffers.g_buf1)
|
||||
*(.buffers.g_buf2)
|
||||
*(.buffers*)
|
||||
_ebuffers = .;
|
||||
} > BUFFERS
|
||||
}
|
File diff suppressed because it is too large
Load Diff
|
@ -1,977 +0,0 @@
|
|||
/******************************************************************************
|
||||
*
|
||||
* Copyright (C) 2016-2018 Texas Instruments Incorporated - http://www.ti.com/
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without
|
||||
* modification, are permitted provided that the following conditions
|
||||
* are met:
|
||||
*
|
||||
* Redistributions of source code must retain the above copyright
|
||||
* notice, this list of conditions and the following disclaimer.
|
||||
*
|
||||
* Redistributions in binary form must reproduce the above copyright
|
||||
* notice, this list of conditions and the following disclaimer in the
|
||||
* documentation and/or other materials provided with the
|
||||
* distribution.
|
||||
*
|
||||
* Neither the name of Texas Instruments Incorporated nor the names of
|
||||
* its contributors may be used to endorse or promote products derived
|
||||
* from this software without specific prior written permission.
|
||||
*
|
||||
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
|
||||
* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
|
||||
* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
|
||||
* A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
|
||||
* OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
|
||||
* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
|
||||
* LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
|
||||
* DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
|
||||
* THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
|
||||
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
|
||||
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
*
|
||||
******************************************************************************/
|
||||
|
||||
#include <stdint.h>
|
||||
#include <stdbool.h>
|
||||
#include "flash.h"
|
||||
|
||||
/******************************************************************************
|
||||
*
|
||||
* Defines for accesses to the security control in the customer configuration
|
||||
* area in flash top sector.
|
||||
*
|
||||
******************************************************************************/
|
||||
#define CCFG_OFFSET_SECURITY CCFG_O_BL_CONFIG
|
||||
#define CCFG_SIZE_SECURITY 0x00000014
|
||||
|
||||
/******************************************************************************
|
||||
*
|
||||
* Default values for security control in customer configuration area in flash
|
||||
* top sector.
|
||||
*
|
||||
******************************************************************************/
|
||||
const uint8_t g_ccfg_default_sec[] = {
|
||||
0xFF, 0xFF, 0xFF, 0xC5,
|
||||
0xFF, 0xFF, 0xFF, 0xFF,
|
||||
0xC5, 0xFF, 0xFF, 0xFF,
|
||||
0xC5, 0xC5, 0xC5, 0xFF,
|
||||
0xC5, 0xC5, 0xC5, 0xFF
|
||||
};
|
||||
|
||||
typedef uint32_t (*flash_prg_pntr_t) (uint8_t *, uint32_t, uint32_t);
|
||||
typedef uint32_t (*flash_sector_erase_pntr_t) (uint32_t);
|
||||
|
||||
/******************************************************************************
|
||||
*
|
||||
* Function prototypes for static functions
|
||||
*
|
||||
******************************************************************************/
|
||||
static void issue_fsm_command(flash_state_command_t command);
|
||||
static void enable_sectors_for_write(void);
|
||||
static uint32_t scale_cycle_values(uint32_t specified_timing,
|
||||
uint32_t scale_value);
|
||||
static void set_write_mode(void);
|
||||
static void trim_for_write(void);
|
||||
static void set_read_mode(void);
|
||||
|
||||
/******************************************************************************
|
||||
*
|
||||
* Erase a flash sector
|
||||
*
|
||||
******************************************************************************/
|
||||
uint32_t flash_sector_erase(uint32_t sector_address)
|
||||
{
|
||||
uint32_t error_return;
|
||||
flash_sector_erase_pntr_t func_pntr;
|
||||
|
||||
/* Call ROM function */
|
||||
func_pntr = (uint32_t (*)(uint32_t))(ROM_API_FLASH_TABLE[5]);
|
||||
error_return = func_pntr(sector_address);
|
||||
|
||||
/* Enable standby because ROM function might have disabled it */
|
||||
HWREGBITW(FLASH_BASE + FLASH_O_CFG, FLASH_CFG_DIS_STANDBY_BITN) = 0;
|
||||
|
||||
/* Return status of operation. */
|
||||
return error_return;
|
||||
}
|
||||
|
||||
/******************************************************************************
|
||||
*
|
||||
* Erase all unprotected sectors in the flash main bank
|
||||
*
|
||||
******************************************************************************/
|
||||
uint32_t flash_bank_erase(bool force_precondition)
|
||||
{
|
||||
uint32_t error_return;
|
||||
uint32_t sector_address;
|
||||
uint32_t reg_val;
|
||||
|
||||
/* Enable all sectors for erase. */
|
||||
enable_sectors_for_write();
|
||||
|
||||
/* Clear the Status register. */
|
||||
issue_fsm_command(FAPI_CLEAR_STATUS);
|
||||
|
||||
/* Enable erase of all sectors and enable precondition if required. */
|
||||
reg_val = HWREG(FLASH_BASE + FLASH_O_FSM_ST_MACHINE);
|
||||
HWREG(FLASH_BASE + FLASH_O_FSM_WR_ENA) = FSM_REG_WRT_ENABLE;
|
||||
HWREG(FLASH_BASE + FLASH_O_FSM_SECTOR1) = 0x00000000;
|
||||
HWREG(FLASH_BASE + FLASH_O_FSM_SECTOR2) = 0x00000000;
|
||||
if (force_precondition)
|
||||
HWREG(FLASH_BASE + FLASH_O_FSM_ST_MACHINE) |=
|
||||
FLASH_FSM_ST_MACHINE_DO_PRECOND;
|
||||
HWREG(FLASH_BASE + FLASH_O_FSM_WR_ENA) = FSM_REG_WRT_DISABLE;
|
||||
|
||||
/* Issue the bank erase command to the FSM. */
|
||||
issue_fsm_command(FAPI_ERASE_BANK);
|
||||
|
||||
/* Wait for erase to finish. */
|
||||
while (flash_check_fsm_for_ready() == FAPI_STATUS_FSM_BUSY)
|
||||
;
|
||||
|
||||
/* Update status. */
|
||||
error_return = flash_check_fsm_for_error();
|
||||
|
||||
/* Disable sectors for erase. */
|
||||
flash_disable_sectors_for_write();
|
||||
|
||||
/* Set configured precondition mode since it may have been forced on. */
|
||||
if (!(reg_val & FLASH_FSM_ST_MACHINE_DO_PRECOND)) {
|
||||
HWREG(FLASH_BASE + FLASH_O_FSM_WR_ENA) = FSM_REG_WRT_ENABLE;
|
||||
HWREG(FLASH_BASE + FLASH_O_FSM_ST_MACHINE) &=
|
||||
~FLASH_FSM_ST_MACHINE_DO_PRECOND;
|
||||
HWREG(FLASH_BASE + FLASH_O_FSM_WR_ENA) = FSM_REG_WRT_DISABLE;
|
||||
}
|
||||
|
||||
/* Program security data to default values in the customer configuration */
|
||||
/* area within the flash top sector if erase was successful. */
|
||||
if (error_return == FAPI_STATUS_SUCCESS) {
|
||||
sector_address = FLASHMEM_BASE + flash_size_get() -
|
||||
flash_sector_size_get();
|
||||
error_return = flash_program((uint8_t *)g_ccfg_default_sec,
|
||||
(sector_address + CCFG_OFFSET_SECURITY),
|
||||
CCFG_SIZE_SECURITY);
|
||||
}
|
||||
|
||||
/* Return status of operation. */
|
||||
return error_return;
|
||||
}
|
||||
|
||||
/******************************************************************************
|
||||
*
|
||||
* Programs unprotected main bank flash sectors
|
||||
*
|
||||
******************************************************************************/
|
||||
uint32_t flash_program(uint8_t *data_buffer, uint32_t address, uint32_t count)
|
||||
{
|
||||
uint32_t error_return;
|
||||
flash_prg_pntr_t func_pntr;
|
||||
|
||||
/* Call ROM function */
|
||||
func_pntr = (uint32_t (*)(uint8_t *, uint32_t, uint32_t))
|
||||
(ROM_API_FLASH_TABLE[6]);
|
||||
error_return = func_pntr(data_buffer, address, count);
|
||||
|
||||
/* Enable standby because ROM function might have disabled it */
|
||||
HWREGBITW(FLASH_BASE + FLASH_O_CFG, FLASH_CFG_DIS_STANDBY_BITN) = 0;
|
||||
|
||||
/* Return status of operation. */
|
||||
return error_return;
|
||||
}
|
||||
|
||||
/******************************************************************************
|
||||
*
|
||||
* Disables all sectors for erase and programming on the active bank
|
||||
*
|
||||
******************************************************************************/
|
||||
void flash_disable_sectors_for_write(void)
|
||||
{
|
||||
/* Configure flash back to read mode */
|
||||
set_read_mode();
|
||||
|
||||
/* Disable Level 1 Protection. */
|
||||
HWREG(FLASH_BASE + FLASH_O_FBPROT) = FLASH_FBPROT_PROTL1DIS;
|
||||
|
||||
/* Disable all sectors for erase and programming. */
|
||||
HWREG(FLASH_BASE + FLASH_O_FBSE) = 0x0000;
|
||||
|
||||
/* Enable Level 1 Protection. */
|
||||
HWREG(FLASH_BASE + FLASH_O_FBPROT) = 0;
|
||||
|
||||
/* Protect sectors from sector erase. */
|
||||
HWREG(FLASH_BASE + FLASH_O_FSM_WR_ENA) = FSM_REG_WRT_ENABLE;
|
||||
HWREG(FLASH_BASE + FLASH_O_FSM_SECTOR1) = 0xFFFFFFFF;
|
||||
HWREG(FLASH_BASE + FLASH_O_FSM_SECTOR2) = 0xFFFFFFFF;
|
||||
HWREG(FLASH_BASE + FLASH_O_FSM_WR_ENA) = FSM_REG_WRT_DISABLE;
|
||||
}
|
||||
|
||||
/******************************************************************************
|
||||
*
|
||||
* Issues a command to the Flash State Machine.
|
||||
*
|
||||
******************************************************************************/
|
||||
static void issue_fsm_command(flash_state_command_t command)
|
||||
{
|
||||
/* Enable write to FSM register. */
|
||||
HWREG(FLASH_BASE + FLASH_O_FSM_WR_ENA) = FSM_REG_WRT_ENABLE;
|
||||
|
||||
/* Issue FSM command. */
|
||||
HWREG(FLASH_BASE + FLASH_O_FSM_CMD) = command;
|
||||
|
||||
/* Start command execute. */
|
||||
HWREG(FLASH_BASE + FLASH_O_FSM_EXECUTE) = FLASH_CMD_EXEC;
|
||||
|
||||
/* Disable write to FSM register. */
|
||||
HWREG(FLASH_BASE + FLASH_O_FSM_WR_ENA) = FSM_REG_WRT_DISABLE;
|
||||
}
|
||||
|
||||
/******************************************************************************
|
||||
*
|
||||
* Enables all sectors for erase and programming on the active bank.
|
||||
*
|
||||
* This function disables the idle reading power reduction mode, selects the
|
||||
* flash bank and enables all sectors for erase and programming on the active
|
||||
* bank.
|
||||
* Sectors may be protected from programming depending on the value of the
|
||||
* FLASH_O_FSM_BSLPx registers.
|
||||
* Sectors may be protected from erase depending on the value of the
|
||||
* FLASH_O_FSM_BSLEx registers. Additional sector erase protection is set by
|
||||
* the FLASH_O_FSM_SECTOR1 register.
|
||||
*
|
||||
******************************************************************************/
|
||||
static void enable_sectors_for_write(void)
|
||||
{
|
||||
/* Trim flash module for program/erase operation. */
|
||||
trim_for_write();
|
||||
|
||||
/* Configure flash to write mode */
|
||||
set_write_mode();
|
||||
|
||||
/* Select flash bank. */
|
||||
HWREG(FLASH_BASE + FLASH_O_FMAC) = 0x00;
|
||||
|
||||
/* Disable Level 1 Protection. */
|
||||
HWREG(FLASH_BASE + FLASH_O_FBPROT) = FLASH_FBPROT_PROTL1DIS;
|
||||
|
||||
/* Enable all sectors for erase and programming. */
|
||||
HWREG(FLASH_BASE + FLASH_O_FBSE) = 0xFFFF;
|
||||
|
||||
/* Enable Level 1 Protection */
|
||||
HWREG(FLASH_BASE + FLASH_O_FBPROT) = 0;
|
||||
}
|
||||
|
||||
/******************************************************************************
|
||||
*
|
||||
* Trims the Flash Bank and Flash Pump for program/erase functionality
|
||||
*
|
||||
* This trimming will make it possible to perform erase and program operations
|
||||
* of the flash. Trim values are loaded from factory configuration area
|
||||
* (referred to as FCGF1). The trimming done by this function is valid until
|
||||
* reset of the flash module.
|
||||
*
|
||||
* Some registers shall be written with a value that is a number of FCLK
|
||||
* cycles. The trim values controlling these registers have a value of
|
||||
* number of half us. FCLK = SysClk / ((RWAIT+1) x 2).
|
||||
*
|
||||
******************************************************************************/
|
||||
static void trim_for_write(void)
|
||||
{
|
||||
uint32_t value;
|
||||
uint32_t temp_val;
|
||||
uint32_t fclk_scale;
|
||||
uint32_t rwait;
|
||||
|
||||
/* Return if flash is already trimmed for program/erase operations. */
|
||||
if (HWREG(FLASH_BASE + FLASH_O_FWFLAG) & FW_WRT_TRIMMED)
|
||||
return;
|
||||
|
||||
/* Configure the FSM registers */
|
||||
|
||||
/* Enable access to the FSM registers. */
|
||||
HWREG(FLASH_BASE + FLASH_O_FSM_WR_ENA) = FSM_REG_WRT_ENABLE;
|
||||
|
||||
/* Determine the scaling value to be used on timing related trim values. */
|
||||
/* The value is based on the flash module clock frequency and RWAIT */
|
||||
rwait = (HWREG(FLASH_BASE + FLASH_O_FRDCTL) &
|
||||
FLASH_FRDCTL_RWAIT_M) >> FLASH_FRDCTL_RWAIT_S;
|
||||
fclk_scale = (16 * FLASH_MODULE_CLK_FREQ) / (rwait + 1);
|
||||
|
||||
/* Configure Program pulse width bits 15:0. */
|
||||
/* (FCFG1 offset 0x188 bits 15:0). */
|
||||
value = (HWREG(FLASH_CFG_BASE + FCFG1_OFFSET + FCFG1_O_FLASH_PROG_EP) &
|
||||
FCFG1_FLASH_PROG_EP_PROGRAM_PW_M) >>
|
||||
FCFG1_FLASH_PROG_EP_PROGRAM_PW_S;
|
||||
|
||||
value = scale_cycle_values(value, fclk_scale);
|
||||
|
||||
HWREG(FLASH_BASE + FLASH_O_FSM_PRG_PW) =
|
||||
(HWREG(FLASH_BASE + FLASH_O_FSM_PRG_PW) &
|
||||
~FLASH_FSM_PRG_PW_PROG_PUL_WIDTH_M) |
|
||||
((value << FLASH_FSM_PRG_PW_PROG_PUL_WIDTH_S) &
|
||||
FLASH_FSM_PRG_PW_PROG_PUL_WIDTH_M);
|
||||
|
||||
/* Configure Erase pulse width bits 31:0. */
|
||||
/* (FCFG1 offset 0x18C bits 31:0). */
|
||||
value = (HWREG(FLASH_CFG_BASE + FCFG1_OFFSET + FCFG1_O_FLASH_ERA_PW) &
|
||||
FCFG1_FLASH_ERA_PW_ERASE_PW_M) >>
|
||||
FCFG1_FLASH_ERA_PW_ERASE_PW_S;
|
||||
|
||||
value = scale_cycle_values(value, fclk_scale);
|
||||
|
||||
HWREG(FLASH_BASE + FLASH_O_FSM_ERA_PW) =
|
||||
(HWREG(FLASH_BASE + FLASH_O_FSM_ERA_PW) &
|
||||
~FLASH_FSM_ERA_PW_FSM_ERA_PW_M) |
|
||||
((value << FLASH_FSM_ERA_PW_FSM_ERA_PW_S) &
|
||||
FLASH_FSM_ERA_PW_FSM_ERA_PW_M);
|
||||
|
||||
/* Configure no of flash clock cycles from EXECUTEZ going low to the the
|
||||
verify data can be read in the program verify mode bits 7:0. */
|
||||
/* (FCFG1 offset 0x174 bits 23:16). */
|
||||
value = (HWREG(FLASH_CFG_BASE + FCFG1_OFFSET + FCFG1_O_FLASH_C_E_P_R) &
|
||||
FCFG1_FLASH_C_E_P_R_PV_ACCESS_M) >>
|
||||
FCFG1_FLASH_C_E_P_R_PV_ACCESS_S;
|
||||
|
||||
value = scale_cycle_values(value, fclk_scale);
|
||||
|
||||
HWREG(FLASH_BASE + FLASH_O_FSM_EX_VAL) =
|
||||
(HWREG(FLASH_BASE + FLASH_O_FSM_EX_VAL) &
|
||||
~FLASH_FSM_EX_VAL_EXE_VALD_M) |
|
||||
((value << FLASH_FSM_EX_VAL_EXE_VALD_S) &
|
||||
FLASH_FSM_EX_VAL_EXE_VALD_M);
|
||||
|
||||
/* Configure the number of flash clocks from the start of the Read mode at
|
||||
the end of the operations until the FSM clears the BUSY bit in FMSTAT. */
|
||||
/* (FCFG1 offset 0x178 bits 23:16). */
|
||||
value = (HWREG(FLASH_CFG_BASE + FCFG1_OFFSET + FCFG1_O_FLASH_P_R_PV) &
|
||||
FCFG1_FLASH_P_R_PV_RH_M) >>
|
||||
FCFG1_FLASH_P_R_PV_RH_S;
|
||||
|
||||
HWREG(FLASH_BASE + FLASH_O_FSM_RD_H) =
|
||||
(HWREG(FLASH_BASE + FLASH_O_FSM_RD_H) &
|
||||
~FLASH_FSM_RD_H_RD_H_M) |
|
||||
((value << FLASH_FSM_RD_H_RD_H_S) &
|
||||
FLASH_FSM_RD_H_RD_H_M);
|
||||
|
||||
/* Configure Program hold time */
|
||||
/* (FCFG1 offset 0x178 bits 31:24). */
|
||||
value = (HWREG(FLASH_CFG_BASE + FCFG1_OFFSET + FCFG1_O_FLASH_P_R_PV) &
|
||||
FCFG1_FLASH_P_R_PV_PH_M) >>
|
||||
FCFG1_FLASH_P_R_PV_PH_S;
|
||||
|
||||
value = scale_cycle_values(value, fclk_scale);
|
||||
|
||||
HWREG(FLASH_BASE + FLASH_O_FSM_P_OH) =
|
||||
(HWREG(FLASH_BASE + FLASH_O_FSM_P_OH) &
|
||||
~FLASH_FSM_P_OH_PGM_OH_M) |
|
||||
((value << FLASH_FSM_P_OH_PGM_OH_S) &
|
||||
FLASH_FSM_P_OH_PGM_OH_M);
|
||||
|
||||
/* Configure Erase hold time */
|
||||
/* (FCFG1 offset 0x17C bits 31:24). */
|
||||
value = (HWREG(FLASH_CFG_BASE + FCFG1_OFFSET + FCFG1_O_FLASH_EH_SEQ) &
|
||||
FCFG1_FLASH_EH_SEQ_EH_M) >>
|
||||
FCFG1_FLASH_EH_SEQ_EH_S;
|
||||
|
||||
value = scale_cycle_values(value, fclk_scale);
|
||||
|
||||
HWREG(FLASH_BASE + FLASH_O_FSM_ERA_OH) =
|
||||
(HWREG(FLASH_BASE + FLASH_O_FSM_ERA_OH) &
|
||||
~FLASH_FSM_ERA_OH_ERA_OH_M) |
|
||||
((value << FLASH_FSM_ERA_OH_ERA_OH_S) &
|
||||
FLASH_FSM_ERA_OH_ERA_OH_M);
|
||||
|
||||
/* Configure Program verify row switch time */
|
||||
/* (FCFG1 offset0x178 bits 15:8). */
|
||||
value = (HWREG(FLASH_CFG_BASE + FCFG1_OFFSET + FCFG1_O_FLASH_P_R_PV) &
|
||||
FCFG1_FLASH_P_R_PV_PVH_M) >>
|
||||
FCFG1_FLASH_P_R_PV_PVH_S;
|
||||
|
||||
value = scale_cycle_values(value, fclk_scale);
|
||||
|
||||
HWREG(FLASH_BASE + FLASH_O_FSM_PE_VH) =
|
||||
(HWREG(FLASH_BASE + FLASH_O_FSM_PE_VH) &
|
||||
~FLASH_FSM_PE_VH_PGM_VH_M) |
|
||||
((value << FLASH_FSM_PE_VH_PGM_VH_S) &
|
||||
FLASH_FSM_PE_VH_PGM_VH_M);
|
||||
|
||||
/* Configure Program Operation Setup time */
|
||||
/* (FCFG1 offset 0x170 bits 31:24). */
|
||||
value = (HWREG(FLASH_CFG_BASE + FCFG1_OFFSET + FCFG1_O_FLASH_E_P) &
|
||||
FCFG1_FLASH_E_P_PSU_M) >>
|
||||
FCFG1_FLASH_E_P_PSU_S;
|
||||
|
||||
HWREG(FLASH_BASE + FLASH_O_FSM_PE_OSU) =
|
||||
(HWREG(FLASH_BASE + FLASH_O_FSM_PE_OSU) &
|
||||
~FLASH_FSM_PE_OSU_PGM_OSU_M) |
|
||||
((value << FLASH_FSM_PE_OSU_PGM_OSU_S) &
|
||||
FLASH_FSM_PE_OSU_PGM_OSU_M);
|
||||
|
||||
/* Configure Erase Operation Setup time */
|
||||
/* (FCGF1 offset 0x170 bits 23:16). */
|
||||
value = (HWREG(FLASH_CFG_BASE + FCFG1_OFFSET + FCFG1_O_FLASH_E_P) &
|
||||
FCFG1_FLASH_E_P_ESU_M) >>
|
||||
FCFG1_FLASH_E_P_ESU_S;
|
||||
|
||||
HWREG(FLASH_BASE + FLASH_O_FSM_PE_OSU) =
|
||||
(HWREG(FLASH_BASE + FLASH_O_FSM_PE_OSU) &
|
||||
~FLASH_FSM_PE_OSU_ERA_OSU_M) |
|
||||
((value << FLASH_FSM_PE_OSU_ERA_OSU_S) &
|
||||
FLASH_FSM_PE_OSU_ERA_OSU_M);
|
||||
|
||||
/* Confgure Program Verify Setup time */
|
||||
/* (FCFG1 offset 0x170 bits 15:8). */
|
||||
value = (HWREG(FLASH_CFG_BASE + FCFG1_OFFSET + FCFG1_O_FLASH_E_P) &
|
||||
FCFG1_FLASH_E_P_PVSU_M) >>
|
||||
FCFG1_FLASH_E_P_PVSU_S;
|
||||
|
||||
HWREG(FLASH_BASE + FLASH_O_FSM_PE_VSU) =
|
||||
(HWREG(FLASH_BASE + FLASH_O_FSM_PE_VSU) &
|
||||
~FLASH_FSM_PE_VSU_PGM_VSU_M) |
|
||||
((value << FLASH_FSM_PE_VSU_PGM_VSU_S) &
|
||||
FLASH_FSM_PE_VSU_PGM_VSU_M);
|
||||
|
||||
/* Configure Erase Verify Setup time */
|
||||
/* (FCFG1 offset 0x170 bits 7:0). */
|
||||
value = (HWREG(FLASH_CFG_BASE + FCFG1_OFFSET + FCFG1_O_FLASH_E_P) &
|
||||
FCFG1_FLASH_E_P_EVSU_M) >>
|
||||
FCFG1_FLASH_E_P_EVSU_S;
|
||||
|
||||
HWREG(FLASH_BASE + FLASH_O_FSM_PE_VSU) =
|
||||
(HWREG(FLASH_BASE + FLASH_O_FSM_PE_VSU) &
|
||||
~FLASH_FSM_PE_VSU_ERA_VSU_M) |
|
||||
((value << FLASH_FSM_PE_VSU_ERA_VSU_S) &
|
||||
FLASH_FSM_PE_VSU_ERA_VSU_M);
|
||||
|
||||
/* Configure Addr to EXECUTEZ low setup time */
|
||||
/* (FCFG1 offset 0x174 bits 15:12). */
|
||||
value = (HWREG(FLASH_CFG_BASE + FCFG1_OFFSET + FCFG1_O_FLASH_C_E_P_R) &
|
||||
FCFG1_FLASH_C_E_P_R_A_EXEZ_SETUP_M) >>
|
||||
FCFG1_FLASH_C_E_P_R_A_EXEZ_SETUP_S;
|
||||
|
||||
HWREG(FLASH_BASE + FLASH_O_FSM_CMP_VSU) =
|
||||
(HWREG(FLASH_BASE + FLASH_O_FSM_CMP_VSU) &
|
||||
~FLASH_FSM_CMP_VSU_ADD_EXZ_M) |
|
||||
((value << FLASH_FSM_CMP_VSU_ADD_EXZ_S) &
|
||||
FLASH_FSM_CMP_VSU_ADD_EXZ_M);
|
||||
|
||||
/* Configure Voltage Status Count */
|
||||
/* (FCFG1 offset 0x17C bits 15:12). */
|
||||
value = (HWREG(FLASH_CFG_BASE + FCFG1_OFFSET + FCFG1_O_FLASH_EH_SEQ) &
|
||||
FCFG1_FLASH_EH_SEQ_VSTAT_M) >>
|
||||
FCFG1_FLASH_EH_SEQ_VSTAT_S;
|
||||
|
||||
HWREG(FLASH_BASE + FLASH_O_FSM_VSTAT) =
|
||||
(HWREG(FLASH_BASE + FLASH_O_FSM_VSTAT) &
|
||||
~FLASH_FSM_VSTAT_VSTAT_CNT_M) |
|
||||
((value << FLASH_FSM_VSTAT_VSTAT_CNT_S) &
|
||||
FLASH_FSM_VSTAT_VSTAT_CNT_M);
|
||||
|
||||
/* Configure Repeat Verify action setup */
|
||||
/* (FCFG1 offset 0x174 bits 31:24). */
|
||||
value = (HWREG(FLASH_CFG_BASE + FCFG1_OFFSET + FCFG1_O_FLASH_C_E_P_R) &
|
||||
FCFG1_FLASH_C_E_P_R_RVSU_M) >>
|
||||
FCFG1_FLASH_C_E_P_R_RVSU_S;
|
||||
|
||||
HWREG(FLASH_BASE + FLASH_O_FSM_EX_VAL) =
|
||||
(HWREG(FLASH_BASE + FLASH_O_FSM_EX_VAL) &
|
||||
~FLASH_FSM_EX_VAL_REP_VSU_M) |
|
||||
((value << FLASH_FSM_EX_VAL_REP_VSU_S) &
|
||||
FLASH_FSM_EX_VAL_REP_VSU_M);
|
||||
|
||||
/* Configure Maximum Programming Pulses */
|
||||
/* (FCFG1 offset 0x184 bits 15:0). */
|
||||
value = (HWREG(FLASH_CFG_BASE + FCFG1_OFFSET + FCFG1_O_FLASH_PP) &
|
||||
FCFG1_FLASH_PP_MAX_PP_M) >>
|
||||
FCFG1_FLASH_PP_MAX_PP_S;
|
||||
|
||||
HWREG(FLASH_BASE + FLASH_O_FSM_PRG_PUL) =
|
||||
(HWREG(FLASH_BASE + FLASH_O_FSM_PRG_PUL) &
|
||||
~FLASH_FSM_PRG_PUL_MAX_PRG_PUL_M) |
|
||||
((value << FLASH_FSM_PRG_PUL_MAX_PRG_PUL_S) &
|
||||
FLASH_FSM_PRG_PUL_MAX_PRG_PUL_M);
|
||||
|
||||
/* Configure Beginning level for VHVCT used during erase modes */
|
||||
/* (FCFG1 offset 0x180 bits 31:16). */
|
||||
value = (HWREG(FLASH_CFG_BASE + FCFG1_OFFSET + FCFG1_O_FLASH_VHV_E) &
|
||||
FCFG1_FLASH_VHV_E_VHV_E_START_M) >>
|
||||
FCFG1_FLASH_VHV_E_VHV_E_START_S;
|
||||
|
||||
HWREG(FLASH_BASE + FLASH_O_FSM_PRG_PUL) =
|
||||
(HWREG(FLASH_BASE + FLASH_O_FSM_PRG_PUL) &
|
||||
~FLASH_FSM_PRG_PUL_BEG_EC_LEVEL_M) |
|
||||
((value << FLASH_FSM_PRG_PUL_BEG_EC_LEVEL_S) &
|
||||
FLASH_FSM_PRG_PUL_BEG_EC_LEVEL_M);
|
||||
|
||||
/* Configure Maximum EC Level */
|
||||
/* (FCFG1 offset 0x2B0 bits 21:18). */
|
||||
value = (HWREG(FLASH_CFG_BASE + FCFG1_OFFSET + FCFG1_O_FLASH_OTP_DATA3) &
|
||||
FCFG1_FLASH_OTP_DATA3_MAX_EC_LEVEL_M) >>
|
||||
FCFG1_FLASH_OTP_DATA3_MAX_EC_LEVEL_S;
|
||||
|
||||
HWREG(FLASH_BASE + FLASH_O_FSM_ERA_PUL) =
|
||||
(HWREG(FLASH_BASE + FLASH_O_FSM_ERA_PUL) &
|
||||
~FLASH_FSM_ERA_PUL_MAX_EC_LEVEL_M) |
|
||||
((value << FLASH_FSM_ERA_PUL_MAX_EC_LEVEL_S) &
|
||||
FLASH_FSM_ERA_PUL_MAX_EC_LEVEL_M);
|
||||
|
||||
/* Configure Maximum Erase Pulses */
|
||||
/* (FCFG1 offset 0x188 bits 31:16). */
|
||||
value = (HWREG(FLASH_CFG_BASE + FCFG1_OFFSET + FCFG1_O_FLASH_PROG_EP) &
|
||||
FCFG1_FLASH_PROG_EP_MAX_EP_M) >>
|
||||
FCFG1_FLASH_PROG_EP_MAX_EP_S;
|
||||
|
||||
HWREG(FLASH_BASE + FLASH_O_FSM_ERA_PUL) =
|
||||
(HWREG(FLASH_BASE + FLASH_O_FSM_ERA_PUL) &
|
||||
~FLASH_FSM_ERA_PUL_MAX_ERA_PUL_M) |
|
||||
((value << FLASH_FSM_ERA_PUL_MAX_ERA_PUL_S) &
|
||||
FLASH_FSM_ERA_PUL_MAX_ERA_PUL_M);
|
||||
|
||||
/* Configure the VHVCT Step Size. This is the number of erase pulses that
|
||||
must be completed for each level before the FSM increments the
|
||||
CUR_EC_LEVEL to the next higher level. Actual erase pulses per level
|
||||
equals (EC_STEP_SIZE +1). The stepping is only needed for the VHVCT
|
||||
voltage. */
|
||||
/* (FCFG1 offset 0x2B0 bits 31:23). */
|
||||
value = (HWREG(FLASH_CFG_BASE + FCFG1_OFFSET + FCFG1_O_FLASH_OTP_DATA3) &
|
||||
FCFG1_FLASH_OTP_DATA3_EC_STEP_SIZE_M) >>
|
||||
FCFG1_FLASH_OTP_DATA3_EC_STEP_SIZE_S;
|
||||
|
||||
HWREG(FLASH_BASE + FLASH_O_FSM_STEP_SIZE) =
|
||||
(HWREG(FLASH_BASE + FLASH_O_FSM_STEP_SIZE) &
|
||||
~FLASH_FSM_STEP_SIZE_EC_STEP_SIZE_M) |
|
||||
((value << FLASH_FSM_STEP_SIZE_EC_STEP_SIZE_S) &
|
||||
FLASH_FSM_STEP_SIZE_EC_STEP_SIZE_M);
|
||||
|
||||
/* Configure the hight of each EC step. This is the number of counts that
|
||||
the CUR_EC_LEVEL will increment when going to a new level. Actual count
|
||||
size equals (EC_STEP_HEIGHT + 1). The stepping applies only to the VHVCT
|
||||
voltage.
|
||||
The read trim value is decremented by 1 before written to the register
|
||||
since actual counts equals (register value + 1). */
|
||||
/* (FCFG1 offset 0x180 bits 15:0). */
|
||||
value = (HWREG(FLASH_CFG_BASE + FCFG1_OFFSET + FCFG1_O_FLASH_VHV_E) &
|
||||
FCFG1_FLASH_VHV_E_VHV_E_STEP_HIGHT_M) >>
|
||||
FCFG1_FLASH_VHV_E_VHV_E_STEP_HIGHT_S;
|
||||
|
||||
HWREG(FLASH_BASE + FLASH_O_FSM_EC_STEP_HEIGHT) = ((value - 1) &
|
||||
FLASH_FSM_EC_STEP_HEIGHT_EC_STEP_HEIGHT_M);
|
||||
|
||||
/* Configure Precondition used in erase operations */
|
||||
/* (FCFG1 offset 0x2B0 bit 22). */
|
||||
value = (HWREG(FLASH_CFG_BASE + FCFG1_OFFSET + FCFG1_O_FLASH_OTP_DATA3) &
|
||||
FCFG1_FLASH_OTP_DATA3_DO_PRECOND_M) >>
|
||||
FCFG1_FLASH_OTP_DATA3_DO_PRECOND_S;
|
||||
|
||||
HWREG(FLASH_BASE + FLASH_O_FSM_ST_MACHINE) =
|
||||
(HWREG(FLASH_BASE + FLASH_O_FSM_ST_MACHINE) &
|
||||
~FLASH_FSM_ST_MACHINE_DO_PRECOND_M) |
|
||||
((value << FLASH_FSM_ST_MACHINE_DO_PRECOND_S) &
|
||||
FLASH_FSM_ST_MACHINE_DO_PRECOND_M);
|
||||
|
||||
/* Enable the recommended Good Time function. */
|
||||
HWREG(FLASH_BASE + FLASH_O_FSM_ST_MACHINE) |=
|
||||
FLASH_FSM_ST_MACHINE_ONE_TIME_GOOD;
|
||||
|
||||
/* Disable write access to FSM registers. */
|
||||
HWREG(FLASH_BASE + FLASH_O_FSM_WR_ENA) = FSM_REG_WRT_DISABLE;
|
||||
|
||||
/* Configure the voltage registers */
|
||||
|
||||
/* Unlock voltage registers (0x2080 - 0x2098). */
|
||||
HWREG(FLASH_BASE + FLASH_O_FLOCK) = 0xAAAA;
|
||||
|
||||
/* Configure voltage level for the specified pump voltage of high
|
||||
voltage supply input during erase operation VHVCT_E and TRIM13_E */
|
||||
/* (FCFG1 offset 0x190 bits[3:0] and bits[11:8]). */
|
||||
temp_val = HWREG(FLASH_CFG_BASE + FCFG1_OFFSET + FCFG1_O_FLASH_VHV);
|
||||
|
||||
value = ((temp_val & FCFG1_FLASH_VHV_TRIM13_E_M)>>
|
||||
FCFG1_FLASH_VHV_TRIM13_E_S) << FLASH_FVHVCT1_TRIM13_E_S;
|
||||
value |= ((temp_val & FCFG1_FLASH_VHV_VHV_E_M)>>
|
||||
FCFG1_FLASH_VHV_VHV_E_S) << FLASH_FVHVCT1_VHVCT_E_S;
|
||||
|
||||
HWREG(FLASH_BASE + FLASH_O_FVHVCT1) = (HWREG(FLASH_BASE + FLASH_O_FVHVCT1) &
|
||||
~(FLASH_FVHVCT1_TRIM13_E_M | FLASH_FVHVCT1_VHVCT_E_M)) | value;
|
||||
|
||||
/* Configure voltage level for the specified pump voltage of high voltage
|
||||
supply input during program verify operation VHVCT_PV and TRIM13_PV */
|
||||
/* (OTP offset 0x194 bits[19:16] and bits[27:24]). */
|
||||
temp_val = HWREG(FLASH_CFG_BASE + FCFG1_OFFSET + FCFG1_O_FLASH_VHV_PV);
|
||||
|
||||
value = ((temp_val & FCFG1_FLASH_VHV_PV_TRIM13_PV_M) >>
|
||||
FCFG1_FLASH_VHV_PV_TRIM13_PV_S) << FLASH_FVHVCT1_TRIM13_PV_S;
|
||||
value |= ((temp_val & FCFG1_FLASH_VHV_PV_VHV_PV_M) >>
|
||||
FCFG1_FLASH_VHV_PV_VHV_PV_S) << FLASH_FVHVCT1_VHVCT_PV_S;
|
||||
|
||||
HWREG(FLASH_BASE + FLASH_O_FVHVCT1) = (HWREG(FLASH_BASE + FLASH_O_FVHVCT1) &
|
||||
~(FLASH_FVHVCT1_TRIM13_PV_M | FLASH_FVHVCT1_VHVCT_PV_M)) | value;
|
||||
|
||||
/* Configure voltage level for the specified pump voltage of high voltage
|
||||
supply input during program operation VHVCT_P and TRIM13_P */
|
||||
/* (FCFG1 offset 0x190 bits[19:16] and bits[27:24]). */
|
||||
temp_val = HWREG(FLASH_CFG_BASE + FCFG1_OFFSET + FCFG1_O_FLASH_VHV);
|
||||
|
||||
value = ((temp_val & FCFG1_FLASH_VHV_TRIM13_P_M) >>
|
||||
FCFG1_FLASH_VHV_TRIM13_P_S) << FLASH_FVHVCT2_TRIM13_P_S;
|
||||
value |= ((temp_val & FCFG1_FLASH_VHV_VHV_P_M) >>
|
||||
FCFG1_FLASH_VHV_VHV_P_S) << FLASH_FVHVCT2_VHVCT_P_S;
|
||||
|
||||
HWREG(FLASH_BASE + FLASH_O_FVHVCT2) = (HWREG(FLASH_BASE + FLASH_O_FVHVCT2) &
|
||||
~(FLASH_FVHVCT2_TRIM13_P_M | FLASH_FVHVCT2_VHVCT_P_M)) | value;
|
||||
|
||||
/* Configure voltage level for the specified pump voltage of wordline power
|
||||
supply for read mode */
|
||||
/* (FCFG1 offset 0x198 Bits 15:8). */
|
||||
value = (HWREG(FLASH_CFG_BASE + FCFG1_OFFSET + FCFG1_O_FLASH_V) &
|
||||
FCFG1_FLASH_V_V_READ_M) >> FCFG1_FLASH_V_V_READ_S;
|
||||
|
||||
HWREG(FLASH_BASE + FLASH_O_FVREADCT) =
|
||||
(HWREG(FLASH_BASE + FLASH_O_FVREADCT) &
|
||||
~FLASH_FVREADCT_VREADCT_M) |
|
||||
((value << FLASH_FVREADCT_VREADCT_S) &
|
||||
FLASH_FVREADCT_VREADCT_M);
|
||||
|
||||
/* Configure the voltage level for the VCG 2.5 CT pump voltage */
|
||||
/* (FCFG1 offset 0x194 bits 15:8). */
|
||||
value = (HWREG(FLASH_CFG_BASE + FCFG1_OFFSET + FCFG1_O_FLASH_VHV_PV) &
|
||||
FCFG1_FLASH_VHV_PV_VCG2P5_M) >>
|
||||
FCFG1_FLASH_VHV_PV_VCG2P5_S;
|
||||
|
||||
HWREG(FLASH_BASE + FLASH_O_FVNVCT) =
|
||||
(HWREG(FLASH_BASE + FLASH_O_FVNVCT) &
|
||||
~FLASH_FVNVCT_VCG2P5CT_M) |
|
||||
((value << FLASH_FVNVCT_VCG2P5CT_S) &
|
||||
FLASH_FVNVCT_VCG2P5CT_M);
|
||||
|
||||
/* Configure the voltage level for the specified pump voltage of high
|
||||
current power input during program operation */
|
||||
/* (FCFG1 offset 0x198 bits 31:24). */
|
||||
value = (HWREG(FLASH_CFG_BASE + FCFG1_OFFSET + FCFG1_O_FLASH_V) &
|
||||
FCFG1_FLASH_V_VSL_P_M) >>
|
||||
FCFG1_FLASH_V_VSL_P_S;
|
||||
|
||||
HWREG(FLASH_BASE + FLASH_O_FVSLP) =
|
||||
(HWREG(FLASH_BASE + FLASH_O_FVSLP) &
|
||||
~FLASH_FVSLP_VSL_P_M) |
|
||||
((value << FLASH_FVSLP_VSL_P_S) &
|
||||
FLASH_FVSLP_VSL_P_M);
|
||||
|
||||
/* Configure the voltage level for the specified pump voltage of wordline
|
||||
power supply during programming operations */
|
||||
/* (OTP offset 0x198 bits 23:16). */
|
||||
value = (HWREG(FLASH_CFG_BASE + FCFG1_OFFSET + FCFG1_O_FLASH_V) &
|
||||
FCFG1_FLASH_V_VWL_P_M) >>
|
||||
FCFG1_FLASH_V_VWL_P_S;
|
||||
|
||||
HWREG(FLASH_BASE + FLASH_O_FVWLCT) =
|
||||
(HWREG(FLASH_BASE + FLASH_O_FVWLCT) &
|
||||
~FLASH_FVWLCT_VWLCT_P_M) |
|
||||
((value << FLASH_FVWLCT_VWLCT_P_S) &
|
||||
FLASH_FVWLCT_VWLCT_P_M);
|
||||
|
||||
/* Configure the pump's TRIM_1P7 port pins. */
|
||||
/* (FCFG1 offset 0x2B0 bits 17:16). */
|
||||
value = (HWREG(FLASH_CFG_BASE + FCFG1_OFFSET + FCFG1_O_FLASH_OTP_DATA3) &
|
||||
FCFG1_FLASH_OTP_DATA3_TRIM_1P7_M) >>
|
||||
FCFG1_FLASH_OTP_DATA3_TRIM_1P7_S;
|
||||
|
||||
HWREG(FLASH_BASE + FLASH_O_FSEQPMP) =
|
||||
(HWREG(FLASH_BASE + FLASH_O_FSEQPMP) &
|
||||
~FLASH_FSEQPMP_TRIM_1P7_M) |
|
||||
((value << FLASH_FSEQPMP_TRIM_1P7_S) &
|
||||
FLASH_FSEQPMP_TRIM_1P7_M);
|
||||
|
||||
/* Lock the voltage registers. */
|
||||
HWREG(FLASH_BASE + FLASH_O_FLOCK) = 0x55AA;
|
||||
|
||||
/* Set trimmed flag. */
|
||||
HWREG(FLASH_BASE + FLASH_O_FWLOCK) = 5;
|
||||
HWREG(FLASH_BASE + FLASH_O_FWFLAG) |= FW_WRT_TRIMMED;
|
||||
HWREG(FLASH_BASE + FLASH_O_FWLOCK) = 0;
|
||||
}
|
||||
|
||||
/******************************************************************************
|
||||
*
|
||||
* Used to scale the TI OTP values based on the FClk scaling value.
|
||||
*
|
||||
******************************************************************************/
|
||||
static uint32_t scale_cycle_values(uint32_t specified_timing,
|
||||
uint32_t scale_value)
|
||||
{
|
||||
uint32_t scaled_value = (specified_timing * scale_value) >> 6;
|
||||
return scaled_value;
|
||||
}
|
||||
|
||||
/******************************************************************************
|
||||
*
|
||||
* Used to set flash in read mode.
|
||||
*
|
||||
* Flash is configured with values loaded from OTP dependent on the current
|
||||
* regulator mode.
|
||||
*
|
||||
******************************************************************************/
|
||||
static void set_read_mode(void)
|
||||
{
|
||||
uint32_t trim_value;
|
||||
uint32_t value;
|
||||
|
||||
/* Configure the STANDBY_MODE_SEL, STANDBY_PW_SEL, DIS_STANDBY, DIS_IDLE,
|
||||
VIN_AT_X and VIN_BY_PASS for read mode */
|
||||
if (HWREG(AON_PMCTL_BASE + AON_PMCTL_O_PWRCTL) &
|
||||
AON_PMCTL_PWRCTL_EXT_REG_MODE) {
|
||||
|
||||
/* Select trim values for external regulator mode:
|
||||
Configure STANDBY_MODE_SEL (OTP offset 0x308 bit 7)
|
||||
Configure STANDBY_PW_SEL (OTP offset 0x308 bit 6:5)
|
||||
Must be done while the register bit field CONFIG.DIS_STANDBY = 1 */
|
||||
HWREG(FLASH_BASE + FLASH_O_CFG) |= FLASH_CFG_DIS_STANDBY;
|
||||
|
||||
trim_value =
|
||||
HWREG(FLASH_CFG_BASE + FCFG1_OFFSET + FCFG1_O_FLASH_OTP_DATA4);
|
||||
|
||||
value = ((trim_value &
|
||||
FCFG1_FLASH_OTP_DATA4_STANDBY_MODE_SEL_EXT_RD_M) >>
|
||||
FCFG1_FLASH_OTP_DATA4_STANDBY_MODE_SEL_EXT_RD_S) <<
|
||||
FLASH_CFG_STANDBY_MODE_SEL_S;
|
||||
|
||||
value |= ((trim_value &
|
||||
FCFG1_FLASH_OTP_DATA4_STANDBY_PW_SEL_EXT_RD_M) >>
|
||||
FCFG1_FLASH_OTP_DATA4_STANDBY_PW_SEL_EXT_RD_S) <<
|
||||
FLASH_CFG_STANDBY_PW_SEL_S;
|
||||
|
||||
/* Configure DIS_STANDBY (OTP offset 0x308 bit 4).
|
||||
Configure DIS_IDLE (OTP offset 0x308 bit 3). */
|
||||
value |= ((trim_value &
|
||||
(FCFG1_FLASH_OTP_DATA4_DIS_STANDBY_EXT_RD_M |
|
||||
FCFG1_FLASH_OTP_DATA4_DIS_IDLE_EXT_RD_M)) >>
|
||||
FCFG1_FLASH_OTP_DATA4_DIS_IDLE_EXT_RD_S) <<
|
||||
FLASH_CFG_DIS_IDLE_S;
|
||||
|
||||
HWREG(FLASH_BASE + FLASH_O_CFG) = (HWREG(FLASH_BASE + FLASH_O_CFG) &
|
||||
~(FLASH_CFG_STANDBY_MODE_SEL_M | FLASH_CFG_STANDBY_PW_SEL_M |
|
||||
FLASH_CFG_DIS_STANDBY_M | FLASH_CFG_DIS_IDLE_M)) | value;
|
||||
|
||||
/* Check if sample and hold functionality is disabled. */
|
||||
if (HWREG(FLASH_BASE + FLASH_O_CFG) & FLASH_CFG_DIS_IDLE) {
|
||||
/* Wait for disabled sample and hold functionality to be stable. */
|
||||
while (!(HWREG(FLASH_BASE+FLASH_O_STAT) & FLASH_STAT_SAMHOLD_DIS))
|
||||
;
|
||||
}
|
||||
|
||||
/* Configure VIN_AT_X (OTP offset 0x308 bits 2:0) */
|
||||
value = ((trim_value &
|
||||
FCFG1_FLASH_OTP_DATA4_VIN_AT_X_EXT_RD_M) >>
|
||||
FCFG1_FLASH_OTP_DATA4_VIN_AT_X_EXT_RD_S) <<
|
||||
FLASH_FSEQPMP_VIN_AT_X_S;
|
||||
|
||||
/* Configure VIN_BY_PASS which is dependent on the VIN_AT_X value.
|
||||
If VIN_AT_X = 7 then VIN_BY_PASS should be 0 otherwise
|
||||
VIN_BY_PASS should be 1 */
|
||||
if (((value & FLASH_FSEQPMP_VIN_AT_X_M) >>
|
||||
FLASH_FSEQPMP_VIN_AT_X_S) != 0x7)
|
||||
value |= FLASH_FSEQPMP_VIN_BY_PASS;
|
||||
|
||||
HWREG(FLASH_BASE + FLASH_O_FLOCK) = 0xAAAA;
|
||||
HWREG(FLASH_BASE + FLASH_O_FSEQPMP) =
|
||||
(HWREG(FLASH_BASE + FLASH_O_FSEQPMP) &
|
||||
~(FLASH_FSEQPMP_VIN_BY_PASS_M |
|
||||
FLASH_FSEQPMP_VIN_AT_X_M)) | value;
|
||||
HWREG(FLASH_BASE + FLASH_O_FLOCK) = 0x55AA;
|
||||
} else {
|
||||
|
||||
/* Select trim values for internal regulator mode:
|
||||
Configure STANDBY_MODE_SEL (OTP offset 0x308 bit 15)
|
||||
COnfigure STANDBY_PW_SEL (OTP offset 0x308 bit 14:13)
|
||||
Must be done while the register bit field CONFIG.DIS_STANDBY = 1 */
|
||||
HWREG(FLASH_BASE + FLASH_O_CFG) |= FLASH_CFG_DIS_STANDBY;
|
||||
|
||||
trim_value =
|
||||
HWREG(FLASH_CFG_BASE + FCFG1_OFFSET + FCFG1_O_FLASH_OTP_DATA4);
|
||||
|
||||
value = ((trim_value &
|
||||
FCFG1_FLASH_OTP_DATA4_STANDBY_MODE_SEL_INT_RD_M) >>
|
||||
FCFG1_FLASH_OTP_DATA4_STANDBY_MODE_SEL_INT_RD_S) <<
|
||||
FLASH_CFG_STANDBY_MODE_SEL_S;
|
||||
|
||||
value |= ((trim_value &
|
||||
FCFG1_FLASH_OTP_DATA4_STANDBY_PW_SEL_INT_RD_M) >>
|
||||
FCFG1_FLASH_OTP_DATA4_STANDBY_PW_SEL_INT_RD_S) <<
|
||||
FLASH_CFG_STANDBY_PW_SEL_S;
|
||||
|
||||
/* Configure DIS_STANDBY (OTP offset 0x308 bit 12).
|
||||
Configure DIS_IDLE (OTP offset 0x308 bit 11). */
|
||||
value |= ((trim_value &
|
||||
(FCFG1_FLASH_OTP_DATA4_DIS_STANDBY_INT_RD_M |
|
||||
FCFG1_FLASH_OTP_DATA4_DIS_IDLE_INT_RD_M)) >>
|
||||
FCFG1_FLASH_OTP_DATA4_DIS_IDLE_INT_RD_S) <<
|
||||
FLASH_CFG_DIS_IDLE_S;
|
||||
|
||||
HWREG(FLASH_BASE + FLASH_O_CFG) = (HWREG(FLASH_BASE + FLASH_O_CFG) &
|
||||
~(FLASH_CFG_STANDBY_MODE_SEL_M | FLASH_CFG_STANDBY_PW_SEL_M |
|
||||
FLASH_CFG_DIS_STANDBY_M | FLASH_CFG_DIS_IDLE_M)) | value;
|
||||
|
||||
/* Check if sample and hold functionality is disabled. */
|
||||
if (HWREG(FLASH_BASE + FLASH_O_CFG) & FLASH_CFG_DIS_IDLE) {
|
||||
/* Wait for disabled sample and hold functionality to be stable. */
|
||||
while (!(HWREG(FLASH_BASE + FLASH_O_STAT) & FLASH_STAT_SAMHOLD_DIS))
|
||||
;
|
||||
}
|
||||
|
||||
/* Configure VIN_AT_X (OTP offset 0x308 bits 10:8) */
|
||||
value = (((trim_value &
|
||||
FCFG1_FLASH_OTP_DATA4_VIN_AT_X_INT_RD_M) >>
|
||||
FCFG1_FLASH_OTP_DATA4_VIN_AT_X_INT_RD_S) <<
|
||||
FLASH_FSEQPMP_VIN_AT_X_S);
|
||||
|
||||
/* Configure VIN_BY_PASS which is dependent on the VIN_AT_X value.
|
||||
If VIN_AT_X = 7 then VIN_BY_PASS should be 0 otherwise
|
||||
VIN_BY_PASS should be 1 */
|
||||
if (((value & FLASH_FSEQPMP_VIN_AT_X_M) >>
|
||||
FLASH_FSEQPMP_VIN_AT_X_S) != 0x7)
|
||||
value |= FLASH_FSEQPMP_VIN_BY_PASS;
|
||||
|
||||
HWREG(FLASH_BASE + FLASH_O_FLOCK) = 0xAAAA;
|
||||
HWREG(FLASH_BASE + FLASH_O_FSEQPMP) =
|
||||
(HWREG(FLASH_BASE + FLASH_O_FSEQPMP) &
|
||||
~(FLASH_FSEQPMP_VIN_BY_PASS_M |
|
||||
FLASH_FSEQPMP_VIN_AT_X_M)) | value;
|
||||
HWREG(FLASH_BASE + FLASH_O_FLOCK) = 0x55AA;
|
||||
}
|
||||
}
|
||||
|
||||
/******************************************************************************
|
||||
*
|
||||
* Used to set flash in write mode.
|
||||
*
|
||||
* Flash is configured with values loaded from OTP dependent on the current
|
||||
* regulator mode.
|
||||
*
|
||||
******************************************************************************/
|
||||
static void set_write_mode(void)
|
||||
{
|
||||
uint32_t trim_value;
|
||||
uint32_t value;
|
||||
|
||||
/* Configure the STANDBY_MODE_SEL, STANDBY_PW_SEL, DIS_STANDBY, DIS_IDLE,
|
||||
VIN_AT_X and VIN_BY_PASS for program/erase mode */
|
||||
if (HWREG(AON_PMCTL_BASE + AON_PMCTL_O_PWRCTL) &
|
||||
AON_PMCTL_PWRCTL_EXT_REG_MODE) {
|
||||
|
||||
/* Select trim values for external regulator mode:
|
||||
Configure STANDBY_MODE_SEL (OTP offset 0x308 bit 23)
|
||||
Configure STANDBY_PW_SEL (OTP offset 0x308 bit 22:21)
|
||||
Must be done while the register bit field CONFIG.DIS_STANDBY = 1 */
|
||||
HWREG(FLASH_BASE + FLASH_O_CFG) |= FLASH_CFG_DIS_STANDBY;
|
||||
|
||||
trim_value =
|
||||
HWREG(FLASH_CFG_BASE + FCFG1_OFFSET + FCFG1_O_FLASH_OTP_DATA4);
|
||||
|
||||
value = ((trim_value &
|
||||
FCFG1_FLASH_OTP_DATA4_STANDBY_MODE_SEL_EXT_WRT_M) >>
|
||||
FCFG1_FLASH_OTP_DATA4_STANDBY_MODE_SEL_EXT_WRT_S) <<
|
||||
FLASH_CFG_STANDBY_MODE_SEL_S;
|
||||
|
||||
value |= ((trim_value &
|
||||
FCFG1_FLASH_OTP_DATA4_STANDBY_PW_SEL_EXT_WRT_M) >>
|
||||
FCFG1_FLASH_OTP_DATA4_STANDBY_PW_SEL_EXT_WRT_S) <<
|
||||
FLASH_CFG_STANDBY_PW_SEL_S;
|
||||
|
||||
/* Configure DIS_STANDBY (OTP offset 0x308 bit 20).
|
||||
Configure DIS_IDLE (OTP offset 0x308 bit 19). */
|
||||
value |= ((trim_value &
|
||||
(FCFG1_FLASH_OTP_DATA4_DIS_STANDBY_EXT_WRT_M |
|
||||
FCFG1_FLASH_OTP_DATA4_DIS_IDLE_EXT_WRT_M)) >>
|
||||
FCFG1_FLASH_OTP_DATA4_DIS_IDLE_EXT_WRT_S) <<
|
||||
FLASH_CFG_DIS_IDLE_S;
|
||||
|
||||
HWREG(FLASH_BASE + FLASH_O_CFG) = (HWREG(FLASH_BASE + FLASH_O_CFG) &
|
||||
~(FLASH_CFG_STANDBY_MODE_SEL_M | FLASH_CFG_STANDBY_PW_SEL_M |
|
||||
FLASH_CFG_DIS_STANDBY_M | FLASH_CFG_DIS_IDLE_M)) | value;
|
||||
|
||||
/* Check if sample and hold functionality is disabled. */
|
||||
if (HWREG(FLASH_BASE + FLASH_O_CFG) & FLASH_CFG_DIS_IDLE) {
|
||||
/* Wait for disabled sample and hold functionality to be stable. */
|
||||
while (!(HWREG(FLASH_BASE + FLASH_O_STAT) & FLASH_STAT_SAMHOLD_DIS))
|
||||
;
|
||||
}
|
||||
|
||||
/* Configure VIN_AT_X (OTP offset 0x308 bits 18:16) */
|
||||
value = ((trim_value &
|
||||
FCFG1_FLASH_OTP_DATA4_VIN_AT_X_EXT_WRT_M) >>
|
||||
FCFG1_FLASH_OTP_DATA4_VIN_AT_X_EXT_WRT_S) <<
|
||||
FLASH_FSEQPMP_VIN_AT_X_S;
|
||||
|
||||
/* Configure VIN_BY_PASS which is dependent on the VIN_AT_X value.
|
||||
If VIN_AT_X = 7 then VIN_BY_PASS should be 0 otherwise
|
||||
VIN_BY_PASS should be 1 */
|
||||
if (((value & FLASH_FSEQPMP_VIN_AT_X_M) >>
|
||||
FLASH_FSEQPMP_VIN_AT_X_S) != 0x7)
|
||||
value |= FLASH_FSEQPMP_VIN_BY_PASS;
|
||||
|
||||
HWREG(FLASH_BASE + FLASH_O_FLOCK) = 0xAAAA;
|
||||
HWREG(FLASH_BASE + FLASH_O_FSEQPMP) =
|
||||
(HWREG(FLASH_BASE + FLASH_O_FSEQPMP) &
|
||||
~(FLASH_FSEQPMP_VIN_BY_PASS_M |
|
||||
FLASH_FSEQPMP_VIN_AT_X_M)) | value;
|
||||
HWREG(FLASH_BASE + FLASH_O_FLOCK) = 0x55AA;
|
||||
} else {
|
||||
/* Select trim values for internal regulator mode:
|
||||
Configure STANDBY_MODE_SEL (OTP offset 0x308 bit 31)
|
||||
COnfigure STANDBY_PW_SEL (OTP offset 0x308 bit 30:29)
|
||||
Must be done while the register bit field CONFIG.DIS_STANDBY = 1 */
|
||||
HWREG(FLASH_BASE + FLASH_O_CFG) |= FLASH_CFG_DIS_STANDBY;
|
||||
|
||||
trim_value =
|
||||
HWREG(FLASH_CFG_BASE + FCFG1_OFFSET + FCFG1_O_FLASH_OTP_DATA4);
|
||||
|
||||
value = ((trim_value &
|
||||
FCFG1_FLASH_OTP_DATA4_STANDBY_MODE_SEL_INT_WRT_M) >>
|
||||
FCFG1_FLASH_OTP_DATA4_STANDBY_MODE_SEL_INT_WRT_S) <<
|
||||
FLASH_CFG_STANDBY_MODE_SEL_S;
|
||||
|
||||
value |= ((trim_value &
|
||||
FCFG1_FLASH_OTP_DATA4_STANDBY_PW_SEL_INT_WRT_M) >>
|
||||
FCFG1_FLASH_OTP_DATA4_STANDBY_PW_SEL_INT_WRT_S) <<
|
||||
FLASH_CFG_STANDBY_PW_SEL_S;
|
||||
|
||||
/* Configure DIS_STANDBY (OTP offset 0x308 bit 28).
|
||||
Configure DIS_IDLE (OTP offset 0x308 bit 27). */
|
||||
value |= ((trim_value &
|
||||
(FCFG1_FLASH_OTP_DATA4_DIS_STANDBY_INT_WRT_M |
|
||||
FCFG1_FLASH_OTP_DATA4_DIS_IDLE_INT_WRT_M)) >>
|
||||
FCFG1_FLASH_OTP_DATA4_DIS_IDLE_INT_WRT_S) <<
|
||||
FLASH_CFG_DIS_IDLE_S;
|
||||
|
||||
HWREG(FLASH_BASE + FLASH_O_CFG) = (HWREG(FLASH_BASE + FLASH_O_CFG) &
|
||||
~(FLASH_CFG_STANDBY_MODE_SEL_M | FLASH_CFG_STANDBY_PW_SEL_M |
|
||||
FLASH_CFG_DIS_STANDBY_M | FLASH_CFG_DIS_IDLE_M)) | value;
|
||||
|
||||
/* Check if sample and hold functionality is disabled. */
|
||||
if (HWREG(FLASH_BASE + FLASH_O_CFG) & FLASH_CFG_DIS_IDLE) {
|
||||
/* Wait for disabled sample and hold functionality to be stable. */
|
||||
while (!(HWREG(FLASH_BASE + FLASH_O_STAT) & FLASH_STAT_SAMHOLD_DIS))
|
||||
;
|
||||
}
|
||||
|
||||
/* Configure VIN_AT_X (OTP offset 0x308 bits 26:24) */
|
||||
value = ((trim_value &
|
||||
FCFG1_FLASH_OTP_DATA4_VIN_AT_X_INT_WRT_M) >>
|
||||
FCFG1_FLASH_OTP_DATA4_VIN_AT_X_INT_WRT_S) <<
|
||||
FLASH_FSEQPMP_VIN_AT_X_S;
|
||||
|
||||
/* Configure VIN_BY_PASS which is dependent on the VIN_AT_X value.
|
||||
If VIN_AT_X = 7 then VIN_BY_PASS should be 0 otherwise
|
||||
VIN_BY_PASS should be 1 */
|
||||
if (((value & FLASH_FSEQPMP_VIN_AT_X_M) >>
|
||||
FLASH_FSEQPMP_VIN_AT_X_S) != 0x7)
|
||||
value |= FLASH_FSEQPMP_VIN_BY_PASS;
|
||||
|
||||
HWREG(FLASH_BASE + FLASH_O_FLOCK) = 0xAAAA;
|
||||
HWREG(FLASH_BASE + FLASH_O_FSEQPMP) =
|
||||
(HWREG(FLASH_BASE + FLASH_O_FSEQPMP) &
|
||||
~(FLASH_FSEQPMP_VIN_BY_PASS_M |
|
||||
FLASH_FSEQPMP_VIN_AT_X_M)) | value;
|
||||
HWREG(FLASH_BASE + FLASH_O_FLOCK) = 0x55AA;
|
||||
}
|
||||
}
|
|
@ -1,378 +0,0 @@
|
|||
/******************************************************************************
|
||||
*
|
||||
* Copyright (C) 2016-2018 Texas Instruments Incorporated - http://www.ti.com/
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without
|
||||
* modification, are permitted provided that the following conditions
|
||||
* are met:
|
||||
*
|
||||
* Redistributions of source code must retain the above copyright
|
||||
* notice, this list of conditions and the following disclaimer.
|
||||
*
|
||||
* Redistributions in binary form must reproduce the above copyright
|
||||
* notice, this list of conditions and the following disclaimer in the
|
||||
* documentation and/or other materials provided with the
|
||||
* distribution.
|
||||
*
|
||||
* Neither the name of Texas Instruments Incorporated nor the names of
|
||||
* its contributors may be used to endorse or promote products derived
|
||||
* from this software without specific prior written permission.
|
||||
*
|
||||
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
|
||||
* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
|
||||
* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
|
||||
* A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
|
||||
* OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
|
||||
* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
|
||||
* LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
|
||||
* DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
|
||||
* THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
|
||||
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
|
||||
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
*
|
||||
******************************************************************************/
|
||||
|
||||
#ifndef OPENOCD_LOADERS_FLASH_CC26XX_FLASH_H
|
||||
#define OPENOCD_LOADERS_FLASH_CC26XX_FLASH_H
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C"
|
||||
{
|
||||
#endif
|
||||
|
||||
#include <stdint.h>
|
||||
#include <stdbool.h>
|
||||
#include "hw_regs.h"
|
||||
|
||||
/* Location of flash in memory map */
|
||||
#define FLASHMEM_BASE 0
|
||||
|
||||
/* Defines to access flash API calls in ROM */
|
||||
#define ROM_API_TABLE ((uint32_t *) 0x10000180)
|
||||
#define ROM_VERSION (ROM_API_TABLE[0])
|
||||
#define ROM_API_FLASH_TABLE ((uint32_t *) (ROM_API_TABLE[10]))
|
||||
|
||||
#if defined(DEVICE_CC26X2)
|
||||
|
||||
/* Agama (CC26x2) specific definitions */
|
||||
|
||||
#define FLASH_ERASE_SIZE 8192
|
||||
/* Agama (and Agama 1M) has a maximum of 132 flash sectors (1056KB / 8KB) */
|
||||
#define FLASH_MAX_SECTOR_COUNT 132
|
||||
#define FLASH_SECTOR_BASE_M 0xFFFFE000
|
||||
|
||||
/* Bootloader Configuration */
|
||||
#define CCFG_O_BL_CONFIG 0x00001FD8
|
||||
|
||||
#elif defined(DEVICE_CC26X0)
|
||||
|
||||
/* Chameleon (CC26x0) specific definitions */
|
||||
|
||||
#define FLASH_ERASE_SIZE 4096
|
||||
/* Chameleon has a maximum of 32 flash sectors (128KB / 4KB) */
|
||||
#define FLASH_MAX_SECTOR_COUNT 32
|
||||
#define FLASH_SECTOR_BASE_M 0xFFFFF000
|
||||
|
||||
/* Bootloader Configuration */
|
||||
#define CCFG_O_BL_CONFIG 0x00000FD8
|
||||
|
||||
#else
|
||||
#error No DEVICE defined.
|
||||
#endif
|
||||
|
||||
/******************************************************************************
|
||||
*
|
||||
* Values that can be returned from the API functions
|
||||
*
|
||||
******************************************************************************/
|
||||
#define FAPI_STATUS_SUCCESS 0x00000000 /* Function completed successfully */
|
||||
#define FAPI_STATUS_FSM_BUSY 0x00000001 /* FSM is Busy */
|
||||
#define FAPI_STATUS_FSM_READY 0x00000002 /* FSM is Ready */
|
||||
#define FAPI_STATUS_INCORRECT_DATABUFFER_LENGTH \
|
||||
0x00000003 /* Incorrect parameter value */
|
||||
#define FAPI_STATUS_FSM_ERROR 0x00000004 /* Operation failed */
|
||||
|
||||
/******************************************************************************
|
||||
*
|
||||
* Define used by the flash programming and erase functions
|
||||
*
|
||||
******************************************************************************/
|
||||
#define ADDR_OFFSET (0x1F800000 - FLASHMEM_BASE)
|
||||
|
||||
/******************************************************************************
|
||||
*
|
||||
* Define used for access to factory configuration area.
|
||||
*
|
||||
******************************************************************************/
|
||||
#define FCFG1_OFFSET 0x1000
|
||||
|
||||
/******************************************************************************
|
||||
*
|
||||
* Define for the clock frequency input to the flash module in number of MHz
|
||||
*
|
||||
******************************************************************************/
|
||||
#define FLASH_MODULE_CLK_FREQ 48
|
||||
|
||||
/******************************************************************************
|
||||
*
|
||||
* Defined values for Flash State Machine commands
|
||||
*
|
||||
******************************************************************************/
|
||||
typedef enum {
|
||||
FAPI_PROGRAM_DATA = 0x0002, /* Program data. */
|
||||
FAPI_ERASE_SECTOR = 0x0006, /* Erase sector. */
|
||||
FAPI_ERASE_BANK = 0x0008, /* Erase bank. */
|
||||
FAPI_VALIDATE_SECTOR = 0x000E, /* Validate sector. */
|
||||
FAPI_CLEAR_STATUS = 0x0010, /* Clear status. */
|
||||
FAPI_PROGRAM_RESUME = 0x0014, /* Program resume. */
|
||||
FAPI_ERASE_RESUME = 0x0016, /* Erase resume. */
|
||||
FAPI_CLEAR_MORE = 0x0018, /* Clear more. */
|
||||
FAPI_PROGRAM_SECTOR = 0x0020, /* Program sector. */
|
||||
FAPI_ERASE_OTP = 0x0030 /* Erase OTP. */
|
||||
} flash_state_command_t;
|
||||
|
||||
/******************************************************************************
|
||||
*
|
||||
* Defines for values written to the FLASH_O_FSM_WR_ENA register
|
||||
*
|
||||
******************************************************************************/
|
||||
#define FSM_REG_WRT_ENABLE 5
|
||||
#define FSM_REG_WRT_DISABLE 2
|
||||
|
||||
/******************************************************************************
|
||||
*
|
||||
* Defines for the bank power mode field the FLASH_O_FBFALLBACK register
|
||||
*
|
||||
******************************************************************************/
|
||||
#define FBFALLBACK_SLEEP 0
|
||||
#define FBFALLBACK_DEEP_STDBY 1
|
||||
#define FBFALLBACK_ACTIVE 3
|
||||
|
||||
/******************************************************************************
|
||||
*
|
||||
* Defines for the bank grace period and pump grace period
|
||||
*
|
||||
******************************************************************************/
|
||||
#define FLASH_BAGP 0x14
|
||||
#define FLASH_PAGP 0x14
|
||||
|
||||
/******************************************************************************
|
||||
*
|
||||
* Defines for the FW flag bits in the FLASH_O_FWFLAG register
|
||||
*
|
||||
******************************************************************************/
|
||||
#define FW_WRT_TRIMMED 0x00000001
|
||||
|
||||
/******************************************************************************
|
||||
*
|
||||
* Defines used by the flash programming functions
|
||||
*
|
||||
******************************************************************************/
|
||||
typedef volatile uint8_t fwp_write_byte;
|
||||
#define FWPWRITE_BYTE_ADDRESS \
|
||||
((fwp_write_byte *)((FLASH_BASE + FLASH_O_FWPWRITE0)))
|
||||
|
||||
/******************************************************************************
|
||||
*
|
||||
* Define for FSM command execution
|
||||
*
|
||||
******************************************************************************/
|
||||
#define FLASH_CMD_EXEC 0x15
|
||||
|
||||
/******************************************************************************
|
||||
*
|
||||
* Get size of a flash sector in number of bytes.
|
||||
*
|
||||
* This function will return the size of a flash sector in number of bytes.
|
||||
*
|
||||
* Returns size of a flash sector in number of bytes.
|
||||
*
|
||||
******************************************************************************/
|
||||
static inline uint32_t flash_sector_size_get(void)
|
||||
{
|
||||
uint32_t sector_size_in_kbyte;
|
||||
|
||||
sector_size_in_kbyte = (HWREG(FLASH_BASE + FLASH_O_FCFG_B0_SSIZE0) &
|
||||
FLASH_FCFG_B0_SSIZE0_B0_SECT_SIZE_M) >>
|
||||
FLASH_FCFG_B0_SSIZE0_B0_SECT_SIZE_S;
|
||||
|
||||
/* Return flash sector size in number of bytes. */
|
||||
return sector_size_in_kbyte * 1024;
|
||||
}
|
||||
|
||||
/******************************************************************************
|
||||
*
|
||||
* Get the size of the flash.
|
||||
*
|
||||
* This function returns the size of the flash main bank in number of bytes.
|
||||
*
|
||||
* Returns the flash size in number of bytes.
|
||||
*
|
||||
******************************************************************************/
|
||||
static inline uint32_t flash_size_get(void)
|
||||
{
|
||||
uint32_t num_of_sectors;
|
||||
|
||||
/* Get number of flash sectors */
|
||||
num_of_sectors = (HWREG(FLASH_BASE + FLASH_O_FLASH_SIZE) &
|
||||
FLASH_FLASH_SIZE_SECTORS_M) >>
|
||||
FLASH_FLASH_SIZE_SECTORS_S;
|
||||
|
||||
/* Return flash size in number of bytes */
|
||||
return num_of_sectors * flash_sector_size_get();
|
||||
}
|
||||
|
||||
/******************************************************************************
|
||||
*
|
||||
* Checks if the Flash state machine has detected an error.
|
||||
*
|
||||
* This function returns the status of the Flash State Machine indicating if
|
||||
* an error is detected or not. Primary use is to check if an Erase or
|
||||
* Program operation has failed.
|
||||
*
|
||||
* Please note that code can not execute in flash while any part of the flash
|
||||
* is being programmed or erased. This function must be called from ROM or
|
||||
* SRAM while any part of the flash is being programmed or erased.
|
||||
*
|
||||
* Returns status of Flash state machine:
|
||||
* FAPI_STATUS_FSM_ERROR
|
||||
* FAPI_STATUS_SUCCESS
|
||||
*
|
||||
******************************************************************************/
|
||||
static inline uint32_t flash_check_fsm_for_error(void)
|
||||
{
|
||||
if (HWREG(FLASH_BASE + FLASH_O_FMSTAT) & FLASH_FMSTAT_CSTAT)
|
||||
return FAPI_STATUS_FSM_ERROR;
|
||||
else
|
||||
return FAPI_STATUS_SUCCESS;
|
||||
}
|
||||
|
||||
/******************************************************************************
|
||||
*
|
||||
* Checks if the Flash state machine is ready.
|
||||
*
|
||||
* This function returns the status of the Flash State Machine indicating if
|
||||
* it is ready to accept a new command or not. Primary use is to check if an
|
||||
* Erase or Program operation has finished.
|
||||
*
|
||||
* Please note that code can not execute in flash while any part of the flash
|
||||
* is being programmed or erased. This function must be called from ROM or
|
||||
* SRAM while any part of the flash is being programmed or erased.
|
||||
*
|
||||
* Returns readiness status of Flash state machine:
|
||||
* FAPI_STATUS_FSM_READY
|
||||
* FAPI_STATUS_FSM_BUSY
|
||||
*
|
||||
******************************************************************************/
|
||||
static inline uint32_t flash_check_fsm_for_ready(void)
|
||||
{
|
||||
if (HWREG(FLASH_BASE + FLASH_O_STAT) & FLASH_STAT_BUSY)
|
||||
return FAPI_STATUS_FSM_BUSY;
|
||||
else
|
||||
return FAPI_STATUS_FSM_READY;
|
||||
}
|
||||
|
||||
/******************************************************************************
|
||||
*
|
||||
* Erase a flash sector.
|
||||
*
|
||||
* This function will erase the specified flash sector. The function will
|
||||
* not return until the flash sector has been erased or an error condition
|
||||
* occurred. If flash top sector is erased the function will program the
|
||||
* device security data bytes with default values. The device security
|
||||
* data located in the customer configuration area of the flash top sector,
|
||||
* must have valid values at all times. These values affect the configuration
|
||||
* of the device during boot.
|
||||
*
|
||||
* Please note that code can not execute in flash while any part of the flash
|
||||
* is being programmed or erased. This function must only be executed from ROM
|
||||
* or SRAM.
|
||||
*
|
||||
* sector_address is the starting address in flash of the sector to be
|
||||
* erased.
|
||||
*
|
||||
* Returns the status of the sector erase:
|
||||
* FAPI_STATUS_SUCCESS : Success.
|
||||
* FAPI_STATUS_INCORRECT_DATABUFFER_LENGTH : Invalid argument.
|
||||
* FAPI_STATUS_FSM_ERROR : Programming error was encountered.
|
||||
*
|
||||
******************************************************************************/
|
||||
extern uint32_t flash_sector_erase(uint32_t sector_address);
|
||||
|
||||
/******************************************************************************
|
||||
*
|
||||
* Erase all unprotected sectors in the flash main bank.
|
||||
*
|
||||
* This function will erase all unprotected flash sectors. The function will
|
||||
* not return until the flash sectors has been erased or an error condition
|
||||
* occurred. Since the flash top sector is erased the function will program
|
||||
* the device security data bytes with default values. The device security
|
||||
* data located in the customer configuration area of the flash top sector,
|
||||
* must have valid values at all times. These values affect the configuration
|
||||
* of the device during boot. The execution time of the operation increases if
|
||||
* erase precondition is forced. This will cause the flash module to first
|
||||
* program all 1 bits in the bank to 0 before the actual erase is started.
|
||||
*
|
||||
* force_precondition controls if erase precondition should be forced.
|
||||
*
|
||||
* Returns the status of the sector erase:
|
||||
* FAPI_STATUS_SUCCESS : Success
|
||||
* FAPI_STATUS_FSM_ERROR : Erase error was encountered.
|
||||
*
|
||||
******************************************************************************/
|
||||
extern uint32_t flash_bank_erase(bool force_precondition);
|
||||
|
||||
/******************************************************************************
|
||||
*
|
||||
* Programs unprotected main bank flash sectors.
|
||||
*
|
||||
* This function will program a sequence of bytes into the on-chip flash.
|
||||
* Programming each location consists of the result of an AND operation
|
||||
* of the new data and the existing data; in other words bits that contain
|
||||
* 1 can remain 1 or be changed to 0, but bits that are 0 cannot be changed
|
||||
* to 1. Therefore, a byte can be programmed multiple times as long as these
|
||||
* rules are followed; if a program operation attempts to change a 0 bit to
|
||||
* a 1 bit, that bit will not have its value changed.
|
||||
*
|
||||
* This function will not return until the data has been programmed or an
|
||||
* programming error has occurred.
|
||||
*
|
||||
* Please note that code can not execute in flash while any part of the flash
|
||||
* is being programmed or erased. This function must only be executed from ROM
|
||||
* or SRAM.
|
||||
*
|
||||
* The data_buffer pointer cannot point to flash.
|
||||
*
|
||||
* data_buffer is a pointer to the data to be programmed.
|
||||
* address is the starting address in flash to be programmed.
|
||||
* count is the number of bytes to be programmed.
|
||||
*
|
||||
* Returns status of the flash programming:
|
||||
* FAPI_STATUS_SUCCESS : Success.
|
||||
* FAPI_STATUS_INCORRECT_DATABUFFER_LENGTH : Too many bytes were requested.
|
||||
* FAPI_STATUS_FSM_ERROR : Programming error was encountered.
|
||||
*
|
||||
******************************************************************************/
|
||||
extern uint32_t flash_program(uint8_t *data_buffer, uint32_t address,
|
||||
uint32_t count);
|
||||
|
||||
/******************************************************************************
|
||||
*
|
||||
* Disables all sectors for erase and programming on the active bank.
|
||||
*
|
||||
* This function disables all sectors for erase and programming on the active
|
||||
* bank and enables the Idle Reading Power reduction mode if no low power
|
||||
* mode is configured. Furthermore, an additional level of protection from
|
||||
* erase is enabled.
|
||||
*
|
||||
* Please note that code can not execute in flash while any part of the flash
|
||||
* is being programmed or erased.
|
||||
*
|
||||
******************************************************************************/
|
||||
extern void flash_disable_sectors_for_write(void);
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif /* #ifndef OPENOCD_LOADERS_FLASH_CC26XX_FLASH_H */
|
|
@ -1,177 +0,0 @@
|
|||
/******************************************************************************
|
||||
*
|
||||
* Copyright (C) 2017-2018 Texas Instruments Incorporated - http://www.ti.com/
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without
|
||||
* modification, are permitted provided that the following conditions
|
||||
* are met:
|
||||
*
|
||||
* Redistributions of source code must retain the above copyright
|
||||
* notice, this list of conditions and the following disclaimer.
|
||||
*
|
||||
* Redistributions in binary form must reproduce the above copyright
|
||||
* notice, this list of conditions and the following disclaimer in the
|
||||
* documentation and/or other materials provided with the
|
||||
* distribution.
|
||||
*
|
||||
* Neither the name of Texas Instruments Incorporated nor the names of
|
||||
* its contributors may be used to endorse or promote products derived
|
||||
* from this software without specific prior written permission.
|
||||
*
|
||||
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
|
||||
* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
|
||||
* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
|
||||
* A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
|
||||
* OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
|
||||
* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
|
||||
* LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
|
||||
* DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
|
||||
* THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
|
||||
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
|
||||
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
*
|
||||
******************************************************************************/
|
||||
|
||||
#include <stdint.h>
|
||||
#include <stdbool.h>
|
||||
#include "flashloader.h"
|
||||
#include "flash.h"
|
||||
|
||||
/* Array holding erased state of the flash sectors. */
|
||||
static bool g_is_erased[FLASH_MAX_SECTOR_COUNT];
|
||||
|
||||
extern uint8_t g_retain_buf[];
|
||||
|
||||
uint32_t flashloader_init(struct flash_params *params, uint8_t *buf1,
|
||||
uint8_t *buf2)
|
||||
{
|
||||
/* Initialize params buffers */
|
||||
memset((void *)params, 0, 2 * sizeof(struct flash_params));
|
||||
params[0].buf_addr = (uint32_t)buf1;
|
||||
params[1].buf_addr = (uint32_t)buf2;
|
||||
|
||||
/* Mark all sectors at "not erased" */
|
||||
memset(g_is_erased, false, sizeof(g_is_erased));
|
||||
|
||||
return STATUS_OK;
|
||||
}
|
||||
|
||||
uint32_t flashloader_erase_and_program(uint8_t *src, uint32_t address,
|
||||
uint32_t byte_count)
|
||||
{
|
||||
if (byte_count > BUFFER_LEN)
|
||||
return STATUS_FAILED_INVALID_ARGUMENTS;
|
||||
|
||||
/* Erase affected sectors */
|
||||
uint32_t status = flashloader_erase_sectors(address, byte_count);
|
||||
|
||||
if (status != STATUS_OK)
|
||||
return status;
|
||||
|
||||
/* Program data */
|
||||
status = flashloader_program(src, address, byte_count);
|
||||
|
||||
return status;
|
||||
}
|
||||
|
||||
uint32_t flashloader_program_with_retain(uint8_t *src, uint32_t address,
|
||||
uint32_t byte_count)
|
||||
{
|
||||
#if (BUFFER_LEN > FLASH_ERASE_SIZE)
|
||||
#error Buffer size cannot be larger than the flash sector size!
|
||||
#endif
|
||||
|
||||
uint32_t first_sector_idx;
|
||||
uint32_t last_sector_idx;
|
||||
uint32_t status = STATUS_OK;
|
||||
uint32_t i;
|
||||
|
||||
first_sector_idx = flashloader_address_to_sector(address);
|
||||
last_sector_idx = flashloader_address_to_sector(address + byte_count - 1);
|
||||
|
||||
/* Mark all sectors as "not erased" before starting */
|
||||
memset(g_is_erased, false, sizeof(g_is_erased));
|
||||
|
||||
uint32_t sec_offset = address % FLASH_ERASE_SIZE;
|
||||
uint32_t curr_count;
|
||||
uint32_t src_offset = 0;
|
||||
|
||||
for (i = first_sector_idx; i <= last_sector_idx; i++) {
|
||||
|
||||
/* Chop off at sector boundary if data goes into the next sector. */
|
||||
curr_count = byte_count;
|
||||
if ((address + byte_count) > ((i+1) * FLASH_ERASE_SIZE))
|
||||
curr_count -= (address + byte_count) % FLASH_ERASE_SIZE;
|
||||
|
||||
/* Copy flash sector to retain buffer */
|
||||
memcpy(g_retain_buf, (void *)(i * FLASH_ERASE_SIZE), FLASH_ERASE_SIZE);
|
||||
|
||||
/* Copy data buffer to retain buffer */
|
||||
memcpy(&g_retain_buf[sec_offset], &src[src_offset], curr_count);
|
||||
|
||||
/* Erase and program from retain buffer */
|
||||
status = flashloader_erase_and_program(g_retain_buf,
|
||||
(i * FLASH_ERASE_SIZE), FLASH_ERASE_SIZE);
|
||||
if (status != STATUS_OK)
|
||||
return status;
|
||||
|
||||
address += curr_count;
|
||||
sec_offset = address % FLASH_ERASE_SIZE;
|
||||
byte_count -= curr_count;
|
||||
src_offset += curr_count;
|
||||
}
|
||||
|
||||
return status;
|
||||
}
|
||||
|
||||
uint32_t flashloader_erase_all(void)
|
||||
{
|
||||
if (flash_bank_erase(true) != FAPI_STATUS_SUCCESS)
|
||||
return STATUS_FAILED_ERASE_ALL;
|
||||
|
||||
memset(g_is_erased, true, sizeof(g_is_erased));
|
||||
|
||||
return STATUS_OK;
|
||||
}
|
||||
|
||||
uint32_t flashloader_erase_sectors(uint32_t address, uint32_t byte_count)
|
||||
{
|
||||
uint32_t first_sector_idx;
|
||||
uint32_t last_sector_idx;
|
||||
uint32_t status;
|
||||
uint32_t idx;
|
||||
|
||||
/* Floor address to the start of the sector and convert to sector number */
|
||||
first_sector_idx = flashloader_address_to_sector(address);
|
||||
last_sector_idx = flashloader_address_to_sector(address + byte_count - 1);
|
||||
|
||||
/* Erase given sector(s) */
|
||||
for (idx = first_sector_idx; idx <= last_sector_idx; idx++) {
|
||||
|
||||
/* Only erase sectors that haven't already been erased */
|
||||
if (g_is_erased[idx] == false) {
|
||||
status = flash_sector_erase(idx * FLASH_ERASE_SIZE);
|
||||
if (status != FAPI_STATUS_SUCCESS) {
|
||||
status = (STATUS_FAILED_SECTOR_ERASE |
|
||||
((idx << STATUS_EXT_INFO_S) & STATUS_EXT_INFO_M) |
|
||||
((status << STATUS_ROM_CODE_S) & STATUS_ROM_CODE_M));
|
||||
return status;
|
||||
}
|
||||
g_is_erased[idx] = true;
|
||||
}
|
||||
}
|
||||
|
||||
return STATUS_OK;
|
||||
}
|
||||
|
||||
uint32_t flashloader_program(uint8_t *src, uint32_t address,
|
||||
uint32_t byte_count)
|
||||
{
|
||||
uint32_t status = flash_program(src, address, byte_count);
|
||||
if (status != FAPI_STATUS_SUCCESS) {
|
||||
status = (STATUS_FAILED_PROGRAM |
|
||||
((status << STATUS_ROM_CODE_S) & STATUS_ROM_CODE_M));
|
||||
}
|
||||
|
||||
return STATUS_OK;
|
||||
}
|
|
@ -1,187 +0,0 @@
|
|||
/******************************************************************************
|
||||
*
|
||||
* Copyright (C) 2017-2018 Texas Instruments Incorporated - http://www.ti.com/
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without
|
||||
* modification, are permitted provided that the following conditions
|
||||
* are met:
|
||||
*
|
||||
* Redistributions of source code must retain the above copyright
|
||||
* notice, this list of conditions and the following disclaimer.
|
||||
*
|
||||
* Redistributions in binary form must reproduce the above copyright
|
||||
* notice, this list of conditions and the following disclaimer in the
|
||||
* documentation and/or other materials provided with the
|
||||
* distribution.
|
||||
*
|
||||
* Neither the name of Texas Instruments Incorporated nor the names of
|
||||
* its contributors may be used to endorse or promote products derived
|
||||
* from this software without specific prior written permission.
|
||||
*
|
||||
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
|
||||
* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
|
||||
* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
|
||||
* A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
|
||||
* OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
|
||||
* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
|
||||
* LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
|
||||
* DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
|
||||
* THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
|
||||
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
|
||||
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
*
|
||||
******************************************************************************/
|
||||
|
||||
#ifndef OPENOCD_LOADERS_FLASH_CC26XX_FLASHLOADER_H
|
||||
#define OPENOCD_LOADERS_FLASH_CC26XX_FLASHLOADER_H
|
||||
|
||||
#include <stdint.h>
|
||||
#include <stdbool.h>
|
||||
#include <string.h>
|
||||
#include "flash.h"
|
||||
|
||||
/* Number of elements in an array */
|
||||
#define NELEMS(a) (sizeof(a) / sizeof(a[0]))
|
||||
|
||||
struct __attribute__((__packed__)) flash_params {
|
||||
uint32_t dest; /* Destination address in flash */
|
||||
uint32_t len; /* Number of bytes */
|
||||
uint32_t cmd; /* Command */
|
||||
uint32_t full; /* Handshake signal. Is buffer ready? */
|
||||
uint32_t buf_addr; /* Address of data buffer. */
|
||||
};
|
||||
|
||||
typedef enum {
|
||||
CMD_NO_ACTION = 0, /* No action, default value */
|
||||
CMD_ERASE_ALL = 1, /* Erase all unprotected sectors */
|
||||
CMD_PROGRAM = 2, /* Program data */
|
||||
CMD_ERASE_AND_PROGRAM = 3, /* Erase and program data */
|
||||
CMD_ERASE_AND_PROGRAM_WITH_RETAIN = 4, /* Erase and program, but retain */
|
||||
/* sector data outside given range */
|
||||
CMD_ERASE_SECTORS = 5 /* Erase unprotected sectors */
|
||||
} flash_commands_t;
|
||||
|
||||
typedef enum {
|
||||
BUFFER_EMPTY = 0x0, /* No data in buffer, flags last task complete */
|
||||
BUFFER_FULL = 0xFFFFFFFF /* Buffer has data, flags next task to start */
|
||||
} flash_handshake_t;
|
||||
|
||||
#define STATUS_FLASHLOADER_STATUS_M 0x0000FFFF
|
||||
#define STATUS_FLASHLOADER_STATUS_S 0
|
||||
#define STATUS_ROM_CODE_M 0x00FF0000
|
||||
#define STATUS_ROM_CODE_S 16
|
||||
#define STATUS_EXT_INFO_M 0xFF000000
|
||||
#define STATUS_EXT_INFO_S 24
|
||||
|
||||
typedef enum {
|
||||
STATUS_OK = 0,
|
||||
STATUS_FAILED_ERASE_ALL = 0x101,
|
||||
STATUS_FAILED_SECTOR_ERASE = 0x102,
|
||||
STATUS_FAILED_PROGRAM = 0x103,
|
||||
STATUS_FAILED_INVALID_ARGUMENTS = 0x104,
|
||||
STATUS_FAILED_UNKNOWN_COMMAND = 0x105,
|
||||
} flash_status_t;
|
||||
|
||||
/* The buffer size used by the flashloader. The size of 1 flash sector. */
|
||||
#define BUFFER_LEN FLASH_ERASE_SIZE
|
||||
|
||||
/*
|
||||
* This function initializes the flashloader. The application must
|
||||
* allocate memory for the two data buffers and the flash_params structures.
|
||||
*
|
||||
* params Pointer an flash_params array with 2 elements.
|
||||
* buf1 Pointer to data buffer 1
|
||||
* buf2 Pointer to data buffer 2
|
||||
*
|
||||
* Returns STATUS_OK
|
||||
*
|
||||
*/
|
||||
extern uint32_t flashloader_init(struct flash_params *params, uint8_t *buf1,
|
||||
uint8_t *buf2);
|
||||
|
||||
/*
|
||||
* Erase and program the necessary sectors. Data outside the given
|
||||
* range will be deleted.
|
||||
*
|
||||
* src Pointer to buffer containing the data.
|
||||
* address Start address in device flash
|
||||
* byte_count The number of bytes to program
|
||||
*
|
||||
* Returns STATUS_OK on success. For status on failure:
|
||||
* See flashloader_program() and flashloader_erase_sectors().
|
||||
*
|
||||
*/
|
||||
extern uint32_t flashloader_erase_and_program(uint8_t *src, uint32_t address,
|
||||
uint32_t byte_count);
|
||||
|
||||
/*
|
||||
* Erase and program the device sectors. Data outside the given
|
||||
* data range will be kept unchanged.
|
||||
*
|
||||
* src Pointer to buffer containing the data.
|
||||
* address Start address in device flash
|
||||
* byte_count The number of bytes to program
|
||||
*
|
||||
* Returns STATUS_OK on success. For status on failure:
|
||||
* See flashloader_program() and flashloader_erase_sectors().
|
||||
*
|
||||
*/
|
||||
extern uint32_t flashloader_program_with_retain(uint8_t *src, uint32_t address,
|
||||
uint32_t byte_count);
|
||||
|
||||
/*
|
||||
* Erases all flash sectors (that are not write-protected).
|
||||
*
|
||||
* Returns STATUS_OK on success.
|
||||
*
|
||||
*/
|
||||
extern uint32_t flashloader_erase_all(void);
|
||||
|
||||
/*
|
||||
* Erases the flash sectors affected by the given range.
|
||||
*
|
||||
* This function only erases sectors that are not already erased.
|
||||
*
|
||||
* start_addr The first address in the range.
|
||||
* byte_count The number of bytes in the range.
|
||||
*
|
||||
* Returns STATUS_OK on success. Returns a combined status on failure:
|
||||
* [31:24] The sector that failed.
|
||||
* [23:16] ROM function status code. 0 means success.
|
||||
* [16: 0] STATUS_FAILED_SECTOR_ERASE
|
||||
*
|
||||
*/
|
||||
extern uint32_t flashloader_erase_sectors(uint32_t start_addr,
|
||||
uint32_t byte_count);
|
||||
|
||||
/*
|
||||
* Program the given range.
|
||||
*
|
||||
* This function does not erase anything, it assumes the sectors are ready to
|
||||
* be programmed.
|
||||
*
|
||||
* src Pointer to buffer containing the data.
|
||||
* address Start address in device flash
|
||||
* byte_count The number of bytes to program
|
||||
*
|
||||
* Returns STATUS_OK on success. Returns a combined status value on failure:
|
||||
* [31:16] ROM function status code. 0 means success.
|
||||
* [15:0 ] STATUS_FAILED_PROGRAM
|
||||
*
|
||||
*/
|
||||
extern uint32_t flashloader_program(uint8_t *src, uint32_t address,
|
||||
uint32_t byte_count);
|
||||
|
||||
/*
|
||||
* Convert the input address into a sector number.
|
||||
*
|
||||
* address The address.
|
||||
*
|
||||
* Returns the flash sector which the address resides in. The first sector
|
||||
* is sector 0.
|
||||
*
|
||||
*/
|
||||
static inline uint32_t flashloader_address_to_sector(uint32_t address)
|
||||
{ return (address / FLASH_ERASE_SIZE); };
|
||||
|
||||
#endif /* #ifndef OPENOCD_LOADERS_FLASH_CC26XX_FLASHLOADER_H */
|
File diff suppressed because it is too large
Load Diff
|
@ -1,179 +0,0 @@
|
|||
/******************************************************************************
|
||||
*
|
||||
* Copyright (C) 2017-2018 Texas Instruments Incorporated - http://www.ti.com/
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without
|
||||
* modification, are permitted provided that the following conditions
|
||||
* are met:
|
||||
*
|
||||
* Redistributions of source code must retain the above copyright
|
||||
* notice, this list of conditions and the following disclaimer.
|
||||
*
|
||||
* Redistributions in binary form must reproduce the above copyright
|
||||
* notice, this list of conditions and the following disclaimer in the
|
||||
* documentation and/or other materials provided with the
|
||||
* distribution.
|
||||
*
|
||||
* Neither the name of Texas Instruments Incorporated nor the names of
|
||||
* its contributors may be used to endorse or promote products derived
|
||||
* from this software without specific prior written permission.
|
||||
*
|
||||
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
|
||||
* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
|
||||
* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
|
||||
* A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
|
||||
* OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
|
||||
* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
|
||||
* LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
|
||||
* DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
|
||||
* THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
|
||||
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
|
||||
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
*
|
||||
******************************************************************************/
|
||||
|
||||
#include <stdint.h>
|
||||
#include <stdbool.h>
|
||||
#include "flashloader.h"
|
||||
|
||||
/* Data buffers used by host to communicate with flashloader */
|
||||
|
||||
/* Flashloader parameter structure. */
|
||||
__attribute__ ((section(".buffers.g_cfg")))
|
||||
volatile struct flash_params g_cfg[2];
|
||||
/* Data buffer 1. */
|
||||
__attribute__ ((section(".buffers.g_buf1")))
|
||||
uint8_t g_buf1[BUFFER_LEN];
|
||||
/* Data buffer 2. */
|
||||
__attribute__ ((section(".buffers.g_buf2")))
|
||||
uint8_t g_buf2[BUFFER_LEN];
|
||||
|
||||
/* Buffer used for program with retain feature */
|
||||
__attribute__ ((section(".buffers.g_retain_buf")))
|
||||
uint8_t g_retain_buf[BUFFER_LEN];
|
||||
|
||||
uint32_t g_curr_buf; /* Current buffer used. */
|
||||
uint32_t g_vims_ctl; /* Saved flash cache state. */
|
||||
|
||||
/******************************************************************************
|
||||
*
|
||||
* This function stores the current VIMS configuration before
|
||||
* - disabling VIMS flash cache
|
||||
* - flushing the flash line buffers.
|
||||
*
|
||||
* Note Not using driverlib calls because it requires using "NO_ROM" define in
|
||||
* order to work for both Cha. R1 and R2 using the same code. Manually
|
||||
* doing the steps to minimize code footprint.
|
||||
*
|
||||
******************************************************************************/
|
||||
static void disable_flash_cache()
|
||||
{
|
||||
/* 1. Make sure VIMS is not currently changing mode (VIMS:STAT register) */
|
||||
while ((HWREG(0x40034000) & 0x00000008) == 0x8)
|
||||
;
|
||||
|
||||
/* Save current VIMS:CTL state */
|
||||
g_vims_ctl = HWREG(0x40034004);
|
||||
|
||||
/* 2. Set VIMS mode to OFF and disable flash line buffers */
|
||||
uint32_t new_vims_ctl = g_vims_ctl | 0x33;
|
||||
HWREG(0x40034004) = new_vims_ctl;
|
||||
|
||||
/* 3. Wait for VIMS to have changed mode (VIMS:STAT register) */
|
||||
while ((HWREG(0x40034000) & 0x00000008) == 0x8)
|
||||
;
|
||||
}
|
||||
|
||||
/******************************************************************************
|
||||
*
|
||||
* This function restores the VIMS configuration saved off by
|
||||
* disable_flash_cache().
|
||||
*
|
||||
* Note Not using driverlib calls because it requires using "NO_ROM" define in
|
||||
* order to work for both Cha. R1 and R2 using the same code. Manually
|
||||
* doing the steps to minimize code footprint.
|
||||
*
|
||||
******************************************************************************/
|
||||
static void restore_cache_state()
|
||||
{
|
||||
HWREG(0x40034004) = g_vims_ctl;
|
||||
|
||||
/* Wait for VIMS to have changed mode (VIMS:STAT register) */
|
||||
while ((HWREG(0x40034000) & 0x00000008) == 0x8)
|
||||
;
|
||||
}
|
||||
|
||||
/******************************************************************************
|
||||
*
|
||||
* CC13xx/CC26xx flashloader main function.
|
||||
*
|
||||
******************************************************************************/
|
||||
int main(void)
|
||||
{
|
||||
flashloader_init((struct flash_params *)g_cfg, g_buf1, g_buf2);
|
||||
|
||||
g_curr_buf = 0; /* start with the first buffer */
|
||||
uint32_t status;
|
||||
|
||||
while (1) {
|
||||
/* Wait for host to signal buffer is ready */
|
||||
while (g_cfg[g_curr_buf].full == BUFFER_EMPTY)
|
||||
;
|
||||
|
||||
disable_flash_cache();
|
||||
|
||||
/* Perform requested task */
|
||||
switch (g_cfg[g_curr_buf].cmd) {
|
||||
case CMD_ERASE_ALL:
|
||||
status = flashloader_erase_all();
|
||||
break;
|
||||
case CMD_PROGRAM:
|
||||
status =
|
||||
flashloader_program(
|
||||
(uint8_t *)g_cfg[g_curr_buf].buf_addr,
|
||||
g_cfg[g_curr_buf].dest, g_cfg[g_curr_buf].len);
|
||||
break;
|
||||
case CMD_ERASE_AND_PROGRAM:
|
||||
status =
|
||||
flashloader_erase_and_program(
|
||||
(uint8_t *)g_cfg[g_curr_buf].buf_addr,
|
||||
g_cfg[g_curr_buf].dest, g_cfg[g_curr_buf].len);
|
||||
break;
|
||||
case CMD_ERASE_AND_PROGRAM_WITH_RETAIN:
|
||||
status =
|
||||
flashloader_program_with_retain(
|
||||
(uint8_t *)g_cfg[g_curr_buf].buf_addr,
|
||||
g_cfg[g_curr_buf].dest, g_cfg[g_curr_buf].len);
|
||||
break;
|
||||
case CMD_ERASE_SECTORS:
|
||||
status =
|
||||
flashloader_erase_sectors(g_cfg[g_curr_buf].dest,
|
||||
g_cfg[g_curr_buf].len);
|
||||
break;
|
||||
default:
|
||||
status = STATUS_FAILED_UNKNOWN_COMMAND;
|
||||
break;
|
||||
}
|
||||
|
||||
restore_cache_state();
|
||||
|
||||
/* Enter infinite loop on error condition */
|
||||
if (status != STATUS_OK) {
|
||||
g_cfg[g_curr_buf].full = status;
|
||||
while (1)
|
||||
;
|
||||
}
|
||||
|
||||
/* Mark current task complete, and begin looking at next buffer */
|
||||
g_cfg[g_curr_buf].full = BUFFER_EMPTY;
|
||||
g_curr_buf ^= 1;
|
||||
}
|
||||
}
|
||||
|
||||
void _exit(int status)
|
||||
{
|
||||
/* Enter infinite loop on hitting an exit condition */
|
||||
(void)status; /* Unused parameter */
|
||||
while (1)
|
||||
;
|
||||
}
|
|
@ -1,97 +0,0 @@
|
|||
/******************************************************************************
|
||||
*
|
||||
* Copyright (C) 2018 Texas Instruments Incorporated - http://www.ti.com/
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without
|
||||
* modification, are permitted provided that the following conditions
|
||||
* are met:
|
||||
*
|
||||
* Redistributions of source code must retain the above copyright
|
||||
* notice, this list of conditions and the following disclaimer.
|
||||
*
|
||||
* Redistributions in binary form must reproduce the above copyright
|
||||
* notice, this list of conditions and the following disclaimer in the
|
||||
* documentation and/or other materials provided with the
|
||||
* distribution.
|
||||
*
|
||||
* Neither the name of Texas Instruments Incorporated nor the names of
|
||||
* its contributors may be used to endorse or promote products derived
|
||||
* from this software without specific prior written permission.
|
||||
*
|
||||
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
|
||||
* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
|
||||
* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
|
||||
* A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
|
||||
* OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
|
||||
* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
|
||||
* LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
|
||||
* DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
|
||||
* THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
|
||||
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
|
||||
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
*
|
||||
******************************************************************************/
|
||||
|
||||
#include <stdint.h>
|
||||
|
||||
/******************************************************************************
|
||||
*
|
||||
* The entry point for the application startup code.
|
||||
*
|
||||
******************************************************************************/
|
||||
extern int main(void);
|
||||
|
||||
/******************************************************************************
|
||||
*
|
||||
* Reserve space for the system stack.
|
||||
*
|
||||
******************************************************************************/
|
||||
__attribute__ ((section(".stack")))
|
||||
static uint32_t stack[100];
|
||||
const uint32_t stack_pntr = (uint32_t)stack + sizeof(stack);
|
||||
|
||||
/******************************************************************************
|
||||
*
|
||||
* The following are constructs created by the linker indicating where
|
||||
* the "bss" and "ebss" segments reside in memory.
|
||||
*
|
||||
******************************************************************************/
|
||||
extern uint32_t _bss;
|
||||
extern uint32_t _ebss;
|
||||
|
||||
/******************************************************************************
|
||||
*
|
||||
* This is the entry point that handles setting the stack within the allowed
|
||||
* workspace, initializing the .bss segment, and then jumping to main.
|
||||
*
|
||||
******************************************************************************/
|
||||
__attribute__ ((section(".entry")))
|
||||
void entry(void)
|
||||
{
|
||||
/* Workaround for ITT instructions. */
|
||||
__asm(" NOP");
|
||||
__asm(" NOP");
|
||||
__asm(" NOP");
|
||||
__asm(" NOP");
|
||||
|
||||
/* Initialize stack pointer */
|
||||
__asm(" ldr sp, =stack_pntr");
|
||||
|
||||
/* Zero fill the bss segment. */
|
||||
__asm(" ldr r0, =_bss\n"
|
||||
" ldr r1, =_ebss\n"
|
||||
" mov r2, #0\n"
|
||||
" .thumb_func\n"
|
||||
" zero_loop:\n"
|
||||
" cmp r0, r1\n"
|
||||
" it lt\n"
|
||||
" strlt r2, [r0], #4\n"
|
||||
" blt zero_loop");
|
||||
|
||||
/* Call the application's entry point. */
|
||||
main();
|
||||
|
||||
/* If we ever return, enter an infinite loop */
|
||||
while (1)
|
||||
;
|
||||
}
|
|
@ -1,19 +0,0 @@
|
|||
BIN2C = ../../../../src/helper/bin2char.sh
|
||||
|
||||
CROSS_COMPILE ?= arm-none-eabi-
|
||||
AS = $(CROSS_COMPILE)as
|
||||
OBJCOPY = $(CROSS_COMPILE)objcopy
|
||||
|
||||
all: cc3220sf.inc
|
||||
|
||||
%.elf: %.s
|
||||
$(AS) $< -o $@
|
||||
|
||||
%.bin: %.elf
|
||||
$(OBJCOPY) -Obinary $< $@
|
||||
|
||||
%.inc: %.bin
|
||||
$(BIN2C) < $< > $@
|
||||
|
||||
clean:
|
||||
-rm -f *.elf *.bin *.inc
|
|
@ -1,10 +0,0 @@
|
|||
/* Autogenerated with ../../../../src/helper/bin2char.sh */
|
||||
0xdf,0xf8,0x7c,0xa0,0xdf,0xf8,0x7c,0xb0,0xdf,0xf8,0x7c,0xc0,0x01,0xf0,0x7f,0x03,
|
||||
0x00,0x2b,0x1e,0xd1,0x4f,0xf0,0x00,0x04,0xcc,0xf8,0x00,0x10,0x03,0x68,0xcb,0xf8,
|
||||
0x00,0x30,0x0b,0xf1,0x04,0x0b,0x00,0xf1,0x04,0x00,0xa2,0xf1,0x01,0x02,0x04,0xf1,
|
||||
0x01,0x04,0x01,0xf1,0x04,0x01,0x00,0x2a,0x01,0xd0,0x20,0x2c,0xee,0xd1,0xcc,0xf8,
|
||||
0x20,0xa0,0xdc,0xf8,0x20,0x30,0x13,0xf0,0x01,0x0f,0xfa,0xd1,0x00,0x2a,0xd7,0xd1,
|
||||
0x13,0xe0,0xcc,0xf8,0x00,0x10,0x03,0x68,0xcc,0xf8,0x04,0x30,0xcc,0xf8,0x08,0xa0,
|
||||
0xdc,0xf8,0x08,0x30,0x13,0xf0,0x01,0x0f,0xfa,0xd1,0xa2,0xf1,0x01,0x02,0x00,0xf1,
|
||||
0x04,0x00,0x01,0xf1,0x04,0x01,0x00,0x2a,0xc2,0xd1,0x00,0xbe,0x01,0xbe,0xfc,0xe7,
|
||||
0x01,0x00,0x42,0xa4,0x00,0xd1,0x0f,0x40,0x00,0xd0,0x0f,0x40,
|
|
@ -1,93 +0,0 @@
|
|||
/***************************************************************************
|
||||
* Copyright (C) 2017 by Texas Instruments, 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 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, see <http://www.gnu.org/licenses/>. *
|
||||
***************************************************************************/
|
||||
|
||||
/* Params:
|
||||
* r0 = buffer start address (in)
|
||||
* r1 = flash destination address (in)
|
||||
* r2 = number of words to write (in/out)
|
||||
*/
|
||||
|
||||
.text
|
||||
.cpu cortex-m4
|
||||
.code 16
|
||||
.thumb
|
||||
.syntax unified
|
||||
|
||||
.align 2
|
||||
|
||||
/* r3 = scratchpad
|
||||
* r4 = buffer word counter
|
||||
* r10 = flash programming key
|
||||
* r11 = base FWB address
|
||||
* r12 = base flash regs address
|
||||
*/
|
||||
|
||||
start:
|
||||
ldr r10, =0xa4420001 /* flash programming key */
|
||||
ldr r11, =0x400fd100 /* base of FWB */
|
||||
ldr r12, =0x400fd000 /* base of flash regs */
|
||||
and r3, r1, #0x7f /* is the dest address 32 word aligned? */
|
||||
cmp r3, #0
|
||||
bne program_word /* if not aligned do one word at a time */
|
||||
|
||||
/* program using the write buffers */
|
||||
program_buffer:
|
||||
mov r4, #0 /* start the buffer word counter at 0 */
|
||||
str r1, [r12] /* store the dest addr in FMA */
|
||||
fill_buffer:
|
||||
ldr r3, [r0] /* get the word to write to FWB */
|
||||
str r3, [r11] /* store the word in the FWB */
|
||||
add r11, r11, #4 /* increment the FWB pointer */
|
||||
add r0, r0, #4 /* increment the source pointer */
|
||||
sub r2, r2, #1 /* decrement the total word counter */
|
||||
add r4, r4, #1 /* increment the buffer word counter */
|
||||
add r1, r1, #4 /* increment the dest pointer */
|
||||
cmp r2, #0 /* is the total word counter now 0? */
|
||||
beq buffer_ready /* go to end if total word counter is 0 */
|
||||
cmp r4, #32 /* is the buffer word counter now 32? */
|
||||
bne fill_buffer /* go to continue to fill buffer */
|
||||
buffer_ready:
|
||||
str r10, [r12, #0x20] /* store the key and write bit to FMC2 */
|
||||
wait_buffer_done:
|
||||
ldr r3, [r12, #0x20] /* read FMC2 */
|
||||
tst r3, #1 /* see if the write bit is cleared */
|
||||
bne wait_buffer_done /* go to read FMC2 if bit not cleared */
|
||||
cmp r2, #0 /* is the total word counter now 0? */
|
||||
bne start /* go if there is more to program */
|
||||
b exit
|
||||
|
||||
/* program just one word */
|
||||
program_word:
|
||||
str r1, [r12] /* store the dest addr in FMA */
|
||||
ldr r3, [r0] /* get the word to write to FMD */
|
||||
str r3, [r12, #0x4] /* store the word in FMD */
|
||||
str r10, [r12, #0x8] /* store the key and write bit to FMC */
|
||||
wait_word_done:
|
||||
ldr r3, [r12, #0x8] /* read FMC */
|
||||
tst r3, #1 /* see if the write bit is cleared */
|
||||
bne wait_word_done /* go to read FMC if bit not cleared */
|
||||
sub r2, r2, #1 /* decrement the total word counter */
|
||||
add r0, r0, #4 /* increment the source pointer */
|
||||
add r1, r1, #4 /* increment the dest pointer */
|
||||
cmp r2, #0 /* is the total word counter now 0 */
|
||||
bne start /* go if there is more to program */
|
||||
|
||||
/* end */
|
||||
exit:
|
||||
bkpt #0
|
||||
bkpt #1
|
||||
b exit
|
|
@ -1,72 +0,0 @@
|
|||
/***************************************************************************
|
||||
* Copyright (C) 2014 by Angus Gratton *
|
||||
* Derived from stm32f1x.S:
|
||||
* Copyright (C) 2011 by Andreas Fritiofson *
|
||||
* andreas.fritiofson@gmail.com *
|
||||
* Copyright (C) 2013 by Roman Dmitrienko *
|
||||
* me@iamroman.org *
|
||||
* *
|
||||
* 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, see <http://www.gnu.org/licenses/>. *
|
||||
***************************************************************************/
|
||||
.text
|
||||
.syntax unified
|
||||
.cpu cortex-m0
|
||||
.thumb
|
||||
.thumb_func
|
||||
|
||||
/* Written for NRF51822 (src/flash/nor/nrf51.c) however the NRF NVMC is
|
||||
* very generic (CPU blocks during flash writes), so this is actually
|
||||
* just a generic word-oriented copy routine for Cortex-M0 (also
|
||||
* suitable for Cortex-M0+/M3/M4.)
|
||||
*
|
||||
* To assemble:
|
||||
* arm-none-eabi-gcc -c cortex-m0.S
|
||||
*
|
||||
* To disassemble:
|
||||
* arm-none-eabi-objdump -o cortex-m0.o
|
||||
*
|
||||
* Thanks to Jens Bauer for providing advice on some of the tweaks.
|
||||
*/
|
||||
|
||||
/* Params:
|
||||
* r0 - byte count (in)
|
||||
* r1 - workarea start
|
||||
* r2 - workarea end
|
||||
* r3 - target address
|
||||
* Clobbered:
|
||||
* r4 - rp
|
||||
* r5 - wp, tmp
|
||||
*/
|
||||
|
||||
wait_fifo:
|
||||
ldr r5, [r1, #0] /* read wp */
|
||||
cmp r5, #0 /* abort if wp == 0 */
|
||||
beq exit
|
||||
ldr r4, [r1, #4] /* read rp */
|
||||
cmp r4, r5 /* wait until rp != wp */
|
||||
beq wait_fifo
|
||||
|
||||
ldmia r4!, {r5} /* "*target_address++ = *rp++" */
|
||||
stmia r3!, {r5}
|
||||
|
||||
cmp r4, r2 /* wrap rp at end of work area buffer */
|
||||
bcc no_wrap
|
||||
mov r4, r1
|
||||
adds r4, #8 /* skip rp,wp at start of work area */
|
||||
no_wrap:
|
||||
str r4, [r1, #4] /* write back rp */
|
||||
subs r0, #4 /* decrement byte count */
|
||||
bne wait_fifo /* loop if not done */
|
||||
exit:
|
||||
bkpt #0
|
|
@ -1,110 +0,0 @@
|
|||
/***************************************************************************
|
||||
* Copyright (C) 2011 by Andreas Fritiofson *
|
||||
* andreas.fritiofson@gmail.com *
|
||||
* Copyright (C) 2013 by Roman Dmitrienko *
|
||||
* me@iamroman.org *
|
||||
* *
|
||||
* This program is free software; you can redistribute it and/or modify *
|
||||
* it under the terms of the GNU General Public License as published by *
|
||||
* the Free Software Foundation; either version 2 of the License, or *
|
||||
* (at your option) any later version. *
|
||||
* *
|
||||
* This program is distributed in the hope that it will be useful, *
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of *
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
|
||||
* GNU General Public License for more details. *
|
||||
* *
|
||||
* You should have received a copy of the GNU General Public License *
|
||||
* along with this program; if not, write to the *
|
||||
* Free Software Foundation, Inc., *
|
||||
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. *
|
||||
***************************************************************************/
|
||||
|
||||
.text
|
||||
.syntax unified
|
||||
.cpu cortex-m0
|
||||
.thumb
|
||||
.thumb_func
|
||||
|
||||
/* Params:
|
||||
* r0 - flash base (in), status (out)
|
||||
* r1 - count (word-32bit)
|
||||
* r2 - workarea start
|
||||
* r3 - workarea end
|
||||
* r4 - target address
|
||||
* Clobbered:
|
||||
* r5 - rp
|
||||
* r6 - wp, tmp
|
||||
* r7 - tmp
|
||||
*/
|
||||
|
||||
/* offsets of registers from flash reg base */
|
||||
#define EFM32_MSC_WRITECTRL_OFFSET 0x008
|
||||
#define EFM32_MSC_WRITECMD_OFFSET 0x00c
|
||||
#define EFM32_MSC_ADDRB_OFFSET 0x010
|
||||
#define EFM32_MSC_WDATA_OFFSET 0x018
|
||||
#define EFM32_MSC_STATUS_OFFSET 0x01c
|
||||
|
||||
/* set WREN to 1 */
|
||||
movs r6, #1
|
||||
str r6, [r0, #EFM32_MSC_WRITECTRL_OFFSET]
|
||||
|
||||
wait_fifo:
|
||||
ldr r6, [r2, #0] /* read wp */
|
||||
cmp r6, #0 /* abort if wp == 0 */
|
||||
beq exit
|
||||
ldr r5, [r2, #4] /* read rp */
|
||||
cmp r5, r6 /* wait until rp != wp */
|
||||
beq wait_fifo
|
||||
|
||||
/* store address in MSC_ADDRB */
|
||||
str r4, [r0, #EFM32_MSC_ADDRB_OFFSET]
|
||||
/* set LADDRIM bit */
|
||||
movs r6, #1
|
||||
str r6, [r0, #EFM32_MSC_WRITECMD_OFFSET]
|
||||
/* check status for INVADDR and/or LOCKED */
|
||||
ldr r6, [r0, #EFM32_MSC_STATUS_OFFSET]
|
||||
movs r7, #6
|
||||
tst r6, r7
|
||||
bne error
|
||||
|
||||
/* wait for WDATAREADY */
|
||||
wait_wdataready:
|
||||
ldr r6, [r0, #EFM32_MSC_STATUS_OFFSET]
|
||||
movs r7, #8
|
||||
tst r6, r7
|
||||
beq wait_wdataready
|
||||
|
||||
/* load data to WDATA */
|
||||
ldr r6, [r5]
|
||||
str r6, [r0, #EFM32_MSC_WDATA_OFFSET]
|
||||
/* set WRITEONCE bit */
|
||||
movs r6, #8
|
||||
str r6, [r0, #EFM32_MSC_WRITECMD_OFFSET]
|
||||
|
||||
adds r5, #4 /* rp++ */
|
||||
adds r4, #4 /* target_address++ */
|
||||
|
||||
/* wait until BUSY flag is reset */
|
||||
busy:
|
||||
ldr r6, [r0, #EFM32_MSC_STATUS_OFFSET]
|
||||
movs r7, #1
|
||||
tst r6, r7
|
||||
bne busy
|
||||
|
||||
cmp r5, r3 /* wrap rp at end of buffer */
|
||||
bcc no_wrap
|
||||
mov r5, r2
|
||||
adds r5, #8
|
||||
no_wrap:
|
||||
str r5, [r2, #4] /* store rp */
|
||||
subs r1, r1, #1 /* decrement word count */
|
||||
cmp r1, #0
|
||||
beq exit /* loop if not done */
|
||||
b wait_fifo
|
||||
error:
|
||||
movs r0, #0
|
||||
str r0, [r2, #4] /* set rp = 0 on error */
|
||||
exit:
|
||||
mov r0, r6 /* return status in r0 */
|
||||
bkpt #0
|
|
@ -1,51 +0,0 @@
|
|||
BIN2C = ../../../../src/helper/bin2char.sh
|
||||
|
||||
CROSS_COMPILE ?= riscv64-unknown-elf-
|
||||
|
||||
RISCV_CC=$(CROSS_COMPILE)gcc
|
||||
RISCV_OBJCOPY=$(CROSS_COMPILE)objcopy
|
||||
RISCV_OBJDUMP=$(CROSS_COMPILE)objdump
|
||||
|
||||
CFLAGS = -nostdlib -nostartfiles -Wall -Werror -Os -fPIC -Wunused-result -g
|
||||
RISCV32_CFLAGS = -march=rv32e -mabi=ilp32e $(CFLAGS)
|
||||
RISCV64_CFLAGS = -march=rv64i -mabi=lp64 $(CFLAGS)
|
||||
|
||||
all: riscv32_fespi.inc riscv64_fespi.inc
|
||||
|
||||
.PHONY: clean
|
||||
|
||||
# .c -> .o
|
||||
riscv32_%.o: riscv_%.c
|
||||
$(RISCV_CC) -c $(RISCV32_CFLAGS) $^ -o $@
|
||||
|
||||
riscv64_%.o: riscv_%.c
|
||||
$(RISCV_CC) -c $(RISCV64_CFLAGS) $< -o $@
|
||||
|
||||
# .S -> .o
|
||||
riscv32_%.o: riscv_%.S
|
||||
$(RISCV_CC) -c $(RISCV32_CFLAGS) $^ -o $@
|
||||
|
||||
riscv64_%.o: riscv_%.S
|
||||
$(RISCV_CC) -c $(RISCV64_CFLAGS) $^ -o $@
|
||||
|
||||
# .o -> .elf
|
||||
riscv32_%.elf: riscv32_%.o riscv32_wrapper.o
|
||||
$(RISCV_CC) -T riscv.lds $(RISCV32_CFLAGS) $^ -o $@
|
||||
|
||||
riscv64_%.elf: riscv64_%.o riscv64_wrapper.o
|
||||
$(RISCV_CC) -T riscv.lds $(RISCV64_CFLAGS) $^ -o $@
|
||||
|
||||
# .elf -> .bin
|
||||
%.bin: %.elf
|
||||
$(RISCV_OBJCOPY) -Obinary $< $@
|
||||
|
||||
# .bin -> .inc
|
||||
%.inc: %.bin
|
||||
$(BIN2C) < $< > $@
|
||||
|
||||
# utility
|
||||
%.lst: %.elf
|
||||
$(RISCV_OBJDUMP) -S $< > $@
|
||||
|
||||
clean:
|
||||
-rm -f *.elf *.o *.lst *.bin *.inc
|
|
@ -1,12 +0,0 @@
|
|||
OUTPUT_ARCH( "riscv" )
|
||||
|
||||
SECTIONS
|
||||
{
|
||||
. = 0x12340000;
|
||||
.text :
|
||||
{
|
||||
*(.text.entry)
|
||||
*(.text)
|
||||
}
|
||||
.data : { *(.data) }
|
||||
}
|
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in New Issue