Rodrigo L. Rosa [Wed, 31 Aug 2011 19:32:14 +0000 (12:32 -0700)]
speed up, relocate function
added an attempt to use the non-reseting halting sequence. if it fails, then the full sequence will be attempted. this makes things a bit faster most of the time.
changed the location of a function, avoiding a forward def
Rodrigo L. Rosa [Wed, 31 Aug 2011 04:08:59 +0000 (21:08 -0700)]
fix enter debug mode for locking
added an alternative way to enter debug mode, which does not require restarting the chip.
this will not always work, but in general it will (failure 0.3%), and failure is not a dramatic issue, simply have to use the full sequence.
the user can only access "halt", which uses the full sequence, so the user should not have any problems.
restarting the chip requires reconfiguring the flash module. the doc is very poor, so i'd rather have the two methods, and live with the 0.3%.
Rodrigo L. Rosa [Tue, 30 Aug 2011 21:46:20 +0000 (14:46 -0700)]
fix irlen handling
sometimes the master tap will be enabled, since tap switching is required during halt/lock/unlocking procedures.
now irscan handles this, avoiding unnecessary warnings and preventing errors.
Rodrigo L. Rosa [Tue, 30 Aug 2011 22:13:49 +0000 (15:13 -0700)]
fix debug mode,lock,unlock
got new info regarding setting the chip to debug mode, and locking/unlocking flash memory.
the newer implementation is a bit slower, but always works.
the previous implementation would randomly (as once every 25k-70k times) get the chip into a state where the freescale tool would be necessary. this is fixed now.
added functions to play around with the jtag state machine. they are not the happiest, but are necessary to be able to execute the halting/locking/unlocking sequences.
Rodrigo L. Rosa [Tue, 30 Aug 2011 21:26:05 +0000 (14:26 -0700)]
fix error handling during halt
the user can execute halt, but no enter_debug_mode. modified the error handling to suite this.
the new implementation of unlocking will use enter_debug_mode, and should not get the same errors as the user would, because not being able to enter debug mode is actually success when checking for locked flash.
Rodrigo L. Rosa [Tue, 30 Aug 2011 21:19:09 +0000 (14:19 -0700)]
optional crc for flash writing
crc check was always performed on newly flashed data, now it is optional
flash mem can be locked by writing a specific word to a specific address in flash.
to verify flash, target must be halted, and this will (when the new halt sequence is implemented) require reseting the chip. if the target is reset after writing the lock words, then it will lock, hence the CRC will fail because it is not possible to read stuff from the target.
also added a function that resets the jtag state machine.
this is not used yet, but will be soon.
it is implemented to allow strict control over JTAG state machine, necessary to implement to halt and unlocking sequences.
Jim Paris [Mon, 22 Aug 2011 20:48:14 +0000 (16:48 -0400)]
Fix redbee config files
Currently the board/redbee-*.cfg files incorrectly include the
interface definition. Move the interfaces to interface/,
and create a single board/redbee.cfg that is common to both boards.
Intended usage is now:
openocd -f interface/redbee-econotag.cfg -f board/redbee.cfg
Spencer Oliver [Wed, 10 Aug 2011 21:23:29 +0000 (22:23 +0100)]
ftd2xx: fix build warnings
Due to build warnings introduced in newer versions of ftd2xx we
use strings to report errors rather than result codes. This also
gives us the same behaviour as libftdi.
Signed-off-by: Spencer Oliver <ntfreak@users.sourceforge.net>
Rodrigo L. Rosa [Fri, 5 Aug 2011 18:38:12 +0000 (11:38 -0700)]
renamed for clarity
i had started my code from dsp5683xx, i renamed a bunch of stuff to names i consider to be better.
i believe no one is using this code, so nobody should be affected. (it's not too late to do this change)
After correcting the reply size counter, it should be safe to rely on it
for the number of bytes expected in the USB read, instead of reading the
endpoint maximum. This doesn't make things go any faster but it's nicer and
removes the local buffer.
Signed-off-by: Andreas Fritiofson <andreas.fritiofson@gmail.com>
rlink: simplify and optimize queue fill level checks
Add a helper function for running the queue if it would overflow otherwise.
Use it to simplify the queue fill level checks and optimize in a few cases
that would previously run the queue prematurely.
Signed-off-by: Andreas Fritiofson <andreas.fritiofson@gmail.com>
rlink: fix reply counter to enable sending full buffers
dtc_queue.reply_index was wrongly being increased during out scans, causing
the queue to be sent before the out buffer was full. This patch increases
raw upload speed by 50% or so.
Signed-off-by: Andreas Fritiofson <andreas.fritiofson@gmail.com>
Function mips_m4k_write_memory() does endianess byte swap,
but this procedure break one byte access (temporary array
overwrites content in buffer).
As a fix, this endianess swap and buffer affecting
is preformed only on hword and word accesses (not on byte access).
mips32: Sync Caches to Make Instr Writes Effective
Pprogram that loads another program into memory is actually writing the
D- side cache.
The instructions it has loaded can't be executed until they reach the
I-cache.
After the instructions have been written, the loader should arrange to
write back any containing D-cache line and invalidate any locations
already in the I-cache.
For the MIPS Architecture Release2 cores, we can use synci command
that does this job.
For Release1 we must use "cache" instruction.
For all architectures we use distinct common magic number,
and this should be a uint32_t type.
Otherwise, comparison with macros will yield compilation
warning.
Rodrigo L. Rosa [Tue, 9 Aug 2011 18:25:23 +0000 (11:25 -0700)]
fix tapenabler return code
if tap enable/disable failed then a warning was written to the log, but JIM_OK was returned. if using openocd via a TCP interface to the TCL port, there is no way to catch that the command failed (it didn't enable the tap, so it failed)
now it return an error if it fails.
Andreas Bießmann [Tue, 12 Jul 2011 10:38:22 +0000 (12:38 +0200)]
flash/nor/cfi: fix TopBottom for atmel chips
There are some older atmel nor chips which have negated logic for
TopBottom detection. This patch adds a special handling for the old
chips. This is the same mechanism as implemented in linux kernel.
Signed-off-by: Andreas Bießmann <andreas.devel@gmail.com>
Rodrigo L. Rosa [Wed, 20 Jul 2011 03:03:08 +0000 (20:03 -0700)]
dsp5680xx fix FM clk
before doing anything with the flash module (FM) the clock divider must be set.
if erase_check was the first thing done with the FM after reset then an error would be generated because the clk divider was not set.
now erase_check sets the clk divider.
Rodrigo L. Rosa [Wed, 20 Jul 2011 03:01:19 +0000 (20:01 -0700)]
dps5680xx fix warnings
reorganized code to get rid of compiler warnings
the warning were related to allignment, i do not get these warning on my build system (i've tried setting the compiler flag but it doesn't work, still working on why) so i cannot detect them (yet.)
Luca Bruno [Sat, 9 Jul 2011 21:44:39 +0000 (23:44 +0200)]
Do not append git info to version string when building from released tarball
When building official releases from tarball, git commit info is not
available in the building environment. Thus, automake should not try to
append the git commit to the version string.
Signed-off-by: Luca Bruno <lucab@debian.org> Signed-off-by: Spencer Oliver <ntfreak@users.sourceforge.net>