aboutsummaryrefslogtreecommitdiff
path: root/src/target
AgeCommit message (Collapse)Author
2011-10-31warning fix: remove senseless assignment before bailing out of fn w/errorØyvind Harboe
Change-Id: I822f3adce0eccb880007673d60c7eccf7d36b398 Signed-off-by: Øyvind Harboe <oyvind.harboe@zylin.com> Reviewed-on: http://openocd.zylin.com/144 Tested-by: jenkins Reviewed-by: Peter Stuge <peter@stuge.se>
2011-10-31warnings: null pointer check fixØyvind Harboe
rewrite broken null pointer check code by reducing scope of variable. Change-Id: I8254f6849b187e5c9cd083053cdc11973c6fe339 Signed-off-by: Øyvind Harboe <oyvind.harboe@zylin.com> Reviewed-on: http://openocd.zylin.com/142 Tested-by: jenkins Reviewed-by: Spencer Oliver <spen@spen-soft.co.uk>
2011-10-31bugfixes: tinker a bit with the targets commandØyvind Harboe
return error when target can not be found instead of ERROR_OK, split fn. Change-Id: Iba5232d3862a490d0995c3bfece23685bd6856e3 Signed-off-by: Øyvind Harboe <oyvind.harboe@zylin.com> Reviewed-on: http://openocd.zylin.com/131 Tested-by: jenkins Reviewed-by: Spencer Oliver <spen@spen-soft.co.uk>
2011-10-31dsp563xxx: fix missing error propagation found by clangØyvind Harboe
Change-Id: I7380ce145b4942e21b174f2a810928a877c32bc7 Signed-off-by: Øyvind Harboe <oyvind.harboe@zylin.com> Reviewed-on: http://openocd.zylin.com/140 Tested-by: jenkins Reviewed-by: Spencer Oliver <spen@spen-soft.co.uk>
2011-10-27bugfixes: numerous bugs in error propagation found by clangØyvind Harboe
Change-Id: I784068325b422d1918e28c08544bc5a1332d712f Signed-off-by: Øyvind Harboe <oyvind.harboe@zylin.com> Reviewed-on: http://openocd.zylin.com/130 Tested-by: jenkins Reviewed-by: Øyvind Harboe <oyvindharboe@gmail.com>
2011-10-26clang: fix warning about use of unitialized variableØyvind Harboe
this was a false positive, silence it. Change-Id: I432e0c466c94cf8fd6bbf0ea153c8501a8a261eb Signed-off-by: Øyvind Harboe <oyvind.harboe@zylin.com> Reviewed-on: http://openocd.zylin.com/126 Tested-by: jenkins Reviewed-by: Spencer Oliver <spen@spen-soft.co.uk>
2011-10-25armv7a: fix scan-build warningsAndreas Fritiofson
"Value stored to 'retval' is never read": Check and propagate error "Dereference of null pointer": Probably bogus, maybe triggered by the null check on armv7a, so remove the check since it can't be null anyway. Change-Id: I3bc44e52af1589ff40e6a42deda0ce7f3a25e397 Signed-off-by: Andreas Fritiofson <andreas.fritiofson@gmail.com> Reviewed-on: http://openocd.zylin.com/119 Tested-by: jenkins Reviewed-by: Øyvind Harboe <oyvindharboe@gmail.com>
2011-10-25armv7a: make local functions staticAndreas Fritiofson
Also fix a spelling error and remove the declaration for a non-existent function from the header. Change-Id: I13177e2d81aa167c05c1cc766f06924211e6d735 Signed-off-by: Andreas Fritiofson <andreas.fritiofson@gmail.com> Reviewed-on: http://openocd.zylin.com/118 Tested-by: jenkins Reviewed-by: Øyvind Harboe <oyvindharboe@gmail.com>
2011-10-25armv7m: improve error handlingAndreas Fritiofson
Propagate errors unchanged. Free allocated working area in the error return path. Remove duplicated cleanup code by rewriting the logic. As a side-effect, fixes a scan-build warning. Change-Id: I80e3c0015be672778f916e998c8c2e4f23d7588c Signed-off-by: Andreas Fritiofson <andreas.fritiofson@gmail.com> Reviewed-on: http://openocd.zylin.com/117 Tested-by: jenkins Reviewed-by: Øyvind Harboe <oyvindharboe@gmail.com>
2011-10-24warning: silence gcc by initializing local variablesØyvind Harboe
GCC doesn't understand that these are in fact initialized if they are used. Change-Id: I01988adb0547f785b48d869ddbe44cc17dca4739 Signed-off-by: Øyvind Harboe <oyvind.harboe@zylin.com> Reviewed-on: http://openocd.zylin.com/116 Tested-by: jenkins Reviewed-by: Øyvind Harboe <oyvindharboe@gmail.com>
2011-10-23clang: fix warning w/assert so that clang knows that there will be no ↵Øyvind Harboe
division by zero Change-Id: I98ac62a22f21043bb535a667a4f1f1537ccde2a4 Signed-off-by: Øyvind Harboe <oyvind.harboe@zylin.com> Reviewed-on: http://openocd.zylin.com/42 Tested-by: jenkins Reviewed-by: Øyvind Harboe <oyvindharboe@gmail.com>
2011-10-23clang: fix malloc() warning with assertØyvind Harboe
Change-Id: I989d2655622a9f11f4a0a2994014e42822587ecd Signed-off-by: Øyvind Harboe <oyvind.harboe@zylin.com> Reviewed-on: http://openocd.zylin.com/41 Tested-by: jenkins Reviewed-by: Øyvind Harboe <oyvindharboe@gmail.com>
2011-10-19Unused variablesFreddie Chopin
Fix a few errors with set and unused variables detected by GCC 4.7.0 Change-Id: I59b748e18e514ee9f0cde7883b4ed5116198bd4a Signed-off-by: Freddie Chopin <freddie.chopin@gmail.com> Reviewed-on: http://openocd.zylin.com/36 Tested-by: jenkins Reviewed-by: Spencer Oliver <spen@spen-soft.co.uk>
2011-10-18xscale: fix bug in xscale_receive()Matt Reimer
The code in xscale_receive() that tries to skip invalid reads (i.e. reads that don't have the DBG_SR[0] 'valid' bit set) seems to be wrong, as it only looks at the first word's valid flag rather than each word's own valid flag. Am I reading the code correctly? If so, the attached patch should fix it. If this looks correct, I'll generate a proper patch and commit message. Matt Change-Id: I74ebe2ad7a36d340a9dd3b8487578b6ea7f3cf1e Signed-off-by: Øyvind Harboe <oyvind.harboe@zylin.com> Reviewed-on: http://openocd.zylin.com/32 Tested-by: jenkins Reviewed-by: Øyvind Harboe <oyvindharboe@gmail.com>
2011-10-17target_request: add target_got_message() that can be used to improve DCC ↵Øyvind Harboe
performance API change to allow implementing a back-off algorithm for polling hardware. Change-Id: I6cbe8b4534c8dfeb8442305171ea96b5481c1f17 Signed-off-by: Øyvind Harboe <oyvind.harboe@zylin.com> Reviewed-on: http://openocd.zylin.com/26 Reviewed-by: Øyvind Harboe <oyvindharboe@gmail.com> Tested-by: Øyvind Harboe <oyvindharboe@gmail.com>
2011-10-13target: whitespace cleanupSpencer Oliver
Change-Id: I1453f4f3dc0add529da20577e38b8b82d7d00366 Signed-off-by: Spencer Oliver <ntfreak@users.sourceforge.net> Reviewed-on: http://openocd.zylin.com/18 Reviewed-by: Alex Austin <alex.austin@spectrumdsi.com> Tested-by: Spencer Oliver <spen@spen-soft.co.uk> Reviewed-by: Spencer Oliver <spen@spen-soft.co.uk>
2011-10-13breakpoint : smp software breakpoint issueMichel Jaouen
Change-Id: Iefe78bad71d4fdb38ae412ab8fe2f6282836c22e Signed-off-by: Øyvind Harboe <oyvind.harboe@zylin.com> Reviewed-on: http://openocd.zylin.com/14 Tested-by: Spencer Oliver <spen@spen-soft.co.uk> Reviewed-by: Spencer Oliver <spen@spen-soft.co.uk>
2011-10-11breakpoint : indentationMichel Jaouen
Change-Id: Icdb8f72dbb516cd0dfc612c3d61b6801f6382be6 Signed-off-by: Øyvind Harboe <oyvind.harboe@zylin.com>
2011-10-09cortex_m3: use armv7m's async algorithm implementationAndreas Fritiofson
Signed-off-by: Andreas Fritiofson <andreas.fritiofson@gmail.com>
2011-10-09armv7m: implement async algorithm functionsAndreas Fritiofson
Split armv7m_run_algorithm into two pieces and use them to reimplement it. The arch_info parameter is used to keep context between the two calls, so both calls must refer to the same armv7m_algorithm struct. Ugly but works for a proof-of-concept. Signed-off-by: Andreas Fritiofson <andreas.fritiofson@gmail.com>
2011-10-09target: add async algorithm entries to the target typeAndreas Fritiofson
On supported targets, this may be used to start a long running algorithm in the background so the target may be interacted with during execution and later wait for its completion. The most obvious use case is a double buffered flash algorithm that can upload the next block of data while the algorithm is flashing the current. Signed-off-by: Andreas Fritiofson <andreas.fritiofson@gmail.com>
2011-09-30armv7a ,cortex a : add L1, L2 cache support, va to pa supportMichel Jaouen
2011-09-23add target events, run algorithm and default r/w buffer apiMathias K
Target events are added to get better gdb support. The run algorithm functionality are implemented to support feature fast flash write functionality. The new r/w buffer api is now used to support the special memory address handling. The output of the md command was fixed.
2011-09-23kinetis : fix deadlock on device having hasidcode false.Michel Jaouen
2011-09-16kinetis auto mass erase on secured devicesMathias K
This is a proof of concept to get access to the debug port of a secured kinetis cpu. On full flash erase the cpu is automatically secured and the debug port is not accessible. To get this to work the srst line is needed and the necessary configuration should be added to the configuration file.
2011-08-31usleep to jtag_sleepRodrigo L. Rosa
this will help avoid platform specific timing issues
2011-08-31static for some functionsRodrigo L. Rosa
made two functions into static, since they are not required by anything external
2011-08-31speed up, relocate functionRodrigo L. Rosa
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
2011-08-30removed trailing whitespacesRodrigo L. Rosa
emacs is awesome. replace-regexp RET [ ]+$ RET RET and it's done
2011-08-30fix enter debug mode for lockingRodrigo L. Rosa
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%.
2011-08-30fix irlen handlingRodrigo L. Rosa
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.
2011-08-30fix debug mode,lock,unlockRodrigo L. Rosa
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. Conflicts: src/target/dsp5680xx.c
2011-08-30fix error handling during haltRodrigo L. Rosa
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.
2011-08-30optional crc for flash writingRodrigo L. Rosa
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.
2011-08-30def syntax to match tap irlenRodrigo L. Rosa
the master tap has a 4 bit irlen changed the instructions to be 4 bit, ie, removed the zeros. it makes it clearer to interpret.
2011-08-30cortex_a hybrid & context breakpointsHeythem Bouhaja
2011-08-24remove target argument from gdb packet handling functionsJie Zhang
2011-08-17remove white space before TABJie Zhang
2011-08-12mips: fix potential alignment errorStefan Mahr
2011-08-12mips: fix reading uint32 and uint16 when running on big endian hostStefan Mahr
2011-08-12target: add helper functions to get/set u16 or u32 array from/to bufferStefan Mahr
2011-08-10fix return code from dsp5680xx_readRodrigo L. Rosa
it returned ERROR_OK even though it actually failed. this made the Tcl interface report success, though it had not succeeded.
2011-08-10renamed for clarityRodrigo L. Rosa
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)
2011-08-09mips32 : Fixed memory byte accessDrasko DRASKOVIC
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).
2011-08-09mips32: Sync Caches to Make Instr Writes EffectiveDrasko DRASKOVIC
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.
2011-08-09mips32: Added CP0 coprocessor R/W routinesDrasko DRASKOVIC
This patch adds MIPS32 CP0 coprocessor R/W routines, as well as adequate commands to use these routines via telnet interface. Now is becomes possible to affect CP0 internal registers and configure CPU directly from OpenOCD.
2011-08-09mips_m4k: common_magic should be unsignedDrasko DRASKOVIC
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.
2011-08-09mips32: Removed Unnecessary JTAG Queue FlushDrasko DRASKOVIC
jtag_execute_queue() is executed as a part of mips_ejtag_drscan_32(). No need for this to be done before - removed for optimisation.
2011-08-09Revert "dsp5680xx: disable for now, it generates warnings"Øyvind Harboe
This reverts commit d567df02b9f3e7d2e7e78b3c2907ecad9aa4bbd4.
2011-08-09dsp5680xx fix constante refRodrigo L. Rosa
a counter was incorrectly set when i added the macros i incorrectly called them. fixed that.