Commit Graph

2947 Commits

Author SHA1 Message Date
Zachary T Welch
ca594adb5a add const keyword to some APIs
Add 'const' keyword to 'char *' parameters to allow command handlers to
pass constant string arguments.  These changes allow the 'args' command
handler to be changed to 'const' in a subsequent patch.
2009-11-11 11:53:22 -08:00
Zachary T Welch
9741e126fd change argv to args in command handlers
Subsequent patches expect all command handlers to use a uniform
parameter naming scheme.  In the entire tree, these two files used
standard 'argv' instead of our non-standard 'args'.  This patch opts
to reduces the noise required to unify the command handlers, using
dominant 'args' form.

A future patch may be used to convert us back to the standard argv, but
that requires coordination with all developers to minimize disruptions.
2009-11-11 11:50:36 -08:00
Zachary T Welch
e09d8938f5 script_debug(): improve types
Use unsigned type for number of arguments.
2009-11-11 05:40:48 -08:00
Zachary T Welch
c942969377 command.c: make private routines static
This patch also improves the signature of run_command function.
2009-11-11 05:40:48 -08:00
Zachary T Welch
6a2e83c017 log: improve log_callback_fn signature
Use unsigned type for line number in log_callback_fn signature.
2009-11-11 05:40:48 -08:00
Zachary T Welch
0cd414c7d6 time_support: improve use of types
Update timeval_add_time to use long int; implement timeval_add with it.
Update timeval_ms to check gettimeofday return value, return int64_t.
2009-11-11 05:40:48 -08:00
Zachary T Welch
b7b4efcdf1 makefiles: improve build order
Separates various groups of files to be built in logical succession.
In each layer, the core module (target.c, nand.c, etc.) is built _after_
their helper modules (e.g. image.c, nand_ecc.c) but _before_ any of
their drivers (e.g. arm966e.c, mx3_nand.c).

This allows problems introduced at the bottom of the stack to result
in build failures as soon as possible, as the helpers and core should
wrap portions of them.
2009-11-11 05:40:48 -08:00
David Brownell
d796ce0e4d ETM cleanup
Various cleanups of ETM related code.

 - Saner error return paths
 - Simplify arm7_9 init ... no need for extra zeroing!
 - Shrink some lines
 - Tweak some diagnostics
 - Use shorter name for ETM struct type.
 - Don't exit()

and similar.  The diagnostics look forward to having
this ETM code work with more than just ARM7/ARM9.

Signed-off-by: David Brownell <dbrownell@users.sourceforge.net>
2009-11-11 04:42:50 -08:00
Zachary T Welch
583a293a32 fix bug in ARM720: bugfix 2009-11-10 21:02:30 -08:00
David Brownell
d570e4f6f6 ARM720: bugfix
The "ARM720 uses the new inheritance/nesting scheme" patch
wrongly scrubbed a calloc() from arm720t_target_create().

Signed-off-by: David Brownell <dbrownell@users.sourceforge.net>
2009-11-10 19:06:10 -08:00
David Brownell
61af6a6816 target: MMU-aware init for memory read/write
Start switching MMU handling over to a more sensible scheme.
Having an mmu() method enables MMU-aware behaviors.  Not having
one kicks in simpler ones, with no distinction between virtual
and physical addresses.

Currently only a handful of targets have methods to read/write
physical memory:  just arm720, arm920, and arm926.  They should
all initialize OK now, but the arm*20 parts don't do the "extra"
stuff arm926 does (which should arguably be target-generic).

Also simplify how target_init() loops over all targets by making
it be a normal "for" loop, instead of scattering its three parts
to the four winds.

Signed-off-by: David Brownell <dbrownell@users.sourceforge.net>
2009-11-10 11:58:31 -08:00
David Brownell
6881c1b6d6 target.cfg: (re)move some bogus reset_config lines
General rule, this is all board-specific and doesn't belong
in target config files.  Some of these were just cosmetic.

Signed-off-by: David Brownell <dbrownell@users.sourceforge.net>
2009-11-10 09:25:26 -08:00
Thomas Kindler
85944d4144 stm32.cfg: remove reset_config
Here's a patch for the double-reset problem on STM32.  I've tested
downloading and debugging with GDB and Eclipse, and everything seems
to work fine.

This effectively sets reset_config to none. trst_only would also
be ok, but that's better left to a board configuration file since
not all boards wire it up.

The NVIC is used to trigger reset, which at least on this chip also
pulses nSRST so the whole system does get rest -- exactly once.

Signed-off-by: David Brownell <dbrownell@users.sourceforge.net>
2009-11-10 09:16:12 -08:00
Michael Bruck
627bd19768 arm11: add etmr/etmw registers to access ETM via DBGTAP scan chain
First cut of these commands. Øyvind tinkered a bit with
the number parsing to bring it up to speed + rebased it.
Ready for testing.

Signed-off-by: Øyvind Harboe <oyvind.harboe@zylin.com>
2009-11-10 14:00:24 +01:00
Øyvind Harboe
c202ba7d34 ARM11: remove old mrc/mcr commands
Switch to new commands in config scripts

Signed-off-by: Øyvind Harboe <oyvind.harboe@zylin.com>
2009-11-10 13:13:13 +01:00
Øyvind Harboe
1f357869c1 telo.cfg: fix search paths
Add the missing "target/" prefix for scripts in the
target folder.

Signed-off-by: Øyvind Harboe <oyvind.harboe@zylin.com>
2009-11-10 13:11:17 +01:00
David Brownell
2a4d3c03cd Target: minor cleanup
- improve some names -- a "default" prefix is not descriptive
 - add doxygen @todo entries for some issues
 - avr8 isn't ever going to need those MMU hooks

Signed-off-by: David Brownell <dbrownell@users.sourceforge.net>
2009-11-10 02:01:20 -08:00
David Brownell
508e5c803f ARM920: implement basic MMU ops
mmu() works; virt2phys() fails and logs an error.

Signed-off-by: David Brownell <dbrownell@users.sourceforge.net>
2009-11-10 01:36:59 -08:00
David Brownell
65e3471d78 ARM720: implement basic MMU ops
mmu() works; virt2phys() fails and logs an error.

Signed-off-by: David Brownell <dbrownell@users.sourceforge.net>
2009-11-10 01:35:50 -08:00
David Brownell
0df56714a0 Target: fix bad error messages
And shrink a few too-long lines.

Signed-off-by: David Brownell <dbrownell@users.sourceforge.net>
2009-11-10 01:33:59 -08:00
Øyvind Harboe
031591ead5 httpd: fix warnings, more robust error handling, improved MIME handling
The httpd is work in progress...

No mime type set by default. Let the browser guess.

Signed-off-by: Øyvind Harboe <oyvind.harboe@zylin.com>
2009-11-10 08:50:06 +01:00
Øyvind Harboe
151a270695 tcl: HostOs now picks up eCos as well during compile time
Signed-off-by: Øyvind Harboe <oyvind.harboe@zylin.com>
2009-11-10 08:36:19 +01:00
Zachary T Welch
db6c2871dd svf,xsvf,arm7_9_common: trim forard declarations
Remove forward declarations by reordering command registration.
2009-11-09 21:39:46 -08:00
Zachary T Welch
841721929a command.c: make commands static
Removes useless declarations, moving the handler functions to appear
before their use in the (much bigger) command registriation function.
2009-11-09 21:39:46 -08:00
Zachary T Welch
23d88e5774 server: remove useless declarations
Remove server command declarations, make handler routines static.
2009-11-09 21:39:46 -08:00
Zachary T Welch
8d6dcb9d39 jtag: remove useless declarations
Contrary to my previous assessment, some opportunities to remove forward
declarations were overlooked.  Remove them by moving the definitions
of the command registration and interface structure to the end of files.
2009-11-09 21:39:28 -08:00
Zachary T Welch
ef6387a0c9 target.c: remove useless declarations
This patch removes the last batch of forward references from the tree,
moving the target command registration routines to the end of the file.
2009-11-09 19:24:06 -08:00
Zachary T Welch
2351641b8f {pic32m,stm32}x.c: remove useless declarations
Remove useless forward declarations.
Moves command registrations to end of files.
Moves flash structure definitions to end of files.

Signed-off-by: Zachary T Welch <zw@superlucidity.net>
2009-11-09 18:42:48 -08:00
Zachary T Welch
6cd97f48d0 str{7,9}x*.c: remove useless forward declarations
Remove useless forward declarations.
Moves command registrations to end of files.
Moves flash structure definitions to end of files.

Signed-off-by: Zachary T Welch <zw@superlucidity.net>
2009-11-09 18:42:47 -08:00
Zachary T Welch
041c319d9d flash/<various>.c: remove useless declarations
Remove useless forward declarations.
Moves flash structure definitions to end of files.

Signed-off-by: Zachary T Welch <zw@superlucidity.net>
2009-11-09 18:42:47 -08:00
Zachary T Welch
712d3fc0fb flash/<assorted>.c: remove useless declarations
Remove useless forward declarations.
Moves command registrations to end of files.
Moves flash structure definitions to end of files.

Signed-off-by: Zachary T Welch <zw@superlucidity.net>
2009-11-09 18:42:47 -08:00
Zachary T Welch
4cd02c63e9 flash/at91sam[37].c: remove useless declarations
Remove useless forward declarations.
Moves command registration to end of file.
Moves flash structure definitions to end of files.

Changes a few references to global flash structure to local refs.

Signed-off-by: Zachary T Welch <zw@superlucidity.net>
2009-11-09 18:42:47 -08:00
Zachary T Welch
770716e9e0 flash/lpc2???.c: remove useless declarations
Remove useless forward declarations.
Moves command registrations to end of files.
Moves flash structure definitions to end of files.

Signed-off-by: Zachary T Welch <zw@superlucidity.net>
2009-11-09 18:42:47 -08:00
Zachary T Welch
8b5c5c054d flash/*nand*.c: remove useless declarations
Remove useless forward declarations.
Moves command registration to end of files.
Moves flash structure definition to end of files.

Signed-off-by: Zachary T Welch <zw@superlucidity.net>
2009-11-09 18:42:47 -08:00
Zachary T Welch
5c95741df7 flash/flash.c: remove forward declarations
Remove useless forward declarations.
Moves command registration to end of file.
Moves flash structure definition to end of file.

Signed-off-by: Zachary T Welch <zw@superlucidity.net>
2009-11-09 18:42:47 -08:00
David Brownell
7269ba5eb6 Revert "target: add target->type->has_mmu fn"
This patch introduced a bug preventing flash writes from working
on Cortex-M3 targets like the STM32.  Moreover, it's the wrong
approach for handling no-MMU targets.

The right way to handle no-MMU targets is to provide accessors
for physical addresses, and use them everywhere; and any code
which tries to work with virtual-to-physical mappings should use
a identity mapping (which can be defaulted).

And ... we can tell if a target has an MMU by seeing if it's
got an mmu() method.  No such methood means no MMU.

Signed-off-by: David Brownell <dbrownell@users.sourceforge.net>
2009-11-09 14:46:23 -08:00
David Brownell
d70d9634bf finish removing deprecated/obsolete commands
It's been about a year since these were deprecated and, in most
cases, removed.  There's no point in carrying that documentation,
or backwards compatibility for "jtag_device" and "jtag_speed",
around forever.  (Or a few remnants of obsolete code...)

Removed a few obsolete uses of "jtag_speed":

 - The Calao stuff hasn't worked since July 2008.  (Those Atmel
   targets need to work with a 32KHz core clock after reset until
   board-specific init-reset code sets up the PLL and enables a
   faster JTAg clock.)
 - Parport speed controls don't actually work (tops out at about
   1 MHz on typical HW).
 - In general, speed controls need to live in board.cfg files (or
   sometimes target.cfg files), not interface.cfg ...

Signed-off-by: David Brownell <dbrownell@users.sourceforge.net>
2009-11-09 13:16:32 -08:00
David Brownell
9253ce9bae User's Guide: Flash/NAND doc tweaks
Rename the "Drivers, Options, and Commands" sections to be
just "Driver List" matching the earlier reference.  Add an
example of parallel CFI flash.

Signed-off-by: David Brownell <dbrownell@users.sourceforge.net>
2009-11-09 12:02:23 -08:00
Zachary T Welch
3885ab5a5a src/target: remove 'extern' and wrap headers
Remove extern keywords from function prototypes and wrap long lines.
2009-11-09 09:44:33 -08:00
Zachary T Welch
42cafc9369 target.h: remove extern keyword and wrap
Removes 'extern' keyword from function prototypes and wraps long lines.
2009-11-09 09:44:33 -08:00
Zachary T Welch
994a63c3fe src/{server,pld,svf,xsvf}: remove 'extern' keyword
Removes 'extern' keyword from function declarations in header filess.
2009-11-09 09:44:33 -08:00
Zachary T Welch
81fbc63718 src/flash: remove 'extern' and wrap headers
Removes 'extern' keywords from function prototypes in the flash headers.
Wraps long lines to fit into 80 columns.

Adds multiple inclusion protection for s3c2xx_nand.h.
2009-11-09 09:44:33 -08:00
Zachary T Welch
5e9d18f027 src/jtag: remove 'extern' and wrap headers.
Removes the 'extern' keyword from function declarations.
Wraps long prototypes to fit into 80 columns.

Fixes documentation for jtag_tap_s::{,has}idcode fields.
2009-11-09 09:44:33 -08:00
Zachary T Welch
1712d7835e src/helper: wrap and clean headers.
Remove all useless 'extern' keywords from function prototypes.
Wraps long lines for readability.
2009-11-09 09:44:33 -08:00
David Brownell
4882647f3e User's Guide: bugfix global state info
The "$ocd_HOSTOS" variable was wrongly documented.  Fix its
documentation, and its value on Linux.

Shrink a few of the too-long lines.

Signed-off-by: David Brownell <dbrownell@users.sourceforge.net>
2009-11-09 09:40:55 -08:00
David Brownell
526347f959 EmbeddedICE: minor cleanups
Add comments (Doxygen and normal), remove unused code,
shrink some overlong lines.  Get rid of a forward decl.

Signed-off-by: David Brownell <dbrownell@users.sourceforge.net>
2009-11-09 09:34:51 -08:00
Zachary T Welch
2689f58f2a Overhaul time support API
This patch changes the duration_* API in several ways.  First, it
updates the API to use better names.  Second, string formatting has
been removed from the API (with its associated malloc).  Finally, a
new function added to convert the time into seconds, which can be
used (or formatted) by the caller.  This eliminates hidden calls to
malloc that require associated calls to free().

This patch also removes the useless extern keyword from prototypes,
and it eliminates the duration_t typedef (use 'struct duration').
These API also allows proper error checking, as it is possible for
gettimeofday to fail in certain circumstances.

The consumers have all been chased to use this new API as well, as
there were relatively few cases doing this type of measurement.
In most cases, the code performs additional checks for errors, but
the calling code looks much cleaner in every case.
2009-11-09 01:21:50 -08:00
Zachary T Welch
da3196bf5e Add private header for ARM11 internals.
Reduces confusion about location of associated routines and
reduces clutter in the arm11 header.

Removes extra whitespace around the lines touched by these changes.
2009-11-08 15:47:04 -08:00
Zachary T Welch
e41147bf75 ARM11: remove exports and forward decls
Unneeded exports cause confusion about the module interfaces.
Make almost everything static in the arm11.c module.
2009-11-08 15:47:04 -08:00
David Brownell
b2d01a9e6a ARM: minor simulator cleanup
Make several functions be static.  Shrink some of the overlong
lines.  Use pure tab indents in some places that mixed in spaces.
This gives a minor object code shrink (about 2% on amd64).

Signed-off-by: David Brownell <dbrownell@users.sourceforge.net>
2009-11-08 12:44:28 -08:00