summaryrefslogtreecommitdiff
path: root/src/flash/stellaris.c
diff options
context:
space:
mode:
authormifi <mifi@b42882b7-edfa-0310-969c-e2dbd0fdcd60>2008-01-27 14:05:59 +0000
committermifi <mifi@b42882b7-edfa-0310-969c-e2dbd0fdcd60>2008-01-27 14:05:59 +0000
commitc882cb089477050eb46f5f9fba90ff52179acd71 (patch)
treebd76561bffd5afd45beaf8a29d06ea33f688c6ab /src/flash/stellaris.c
parent8d6292d9a070e87bf49d7d2894cd933795b9e3a8 (diff)
downloadopenocd+libswd-c882cb089477050eb46f5f9fba90ff52179acd71.tar.gz
openocd+libswd-c882cb089477050eb46f5f9fba90ff52179acd71.tar.bz2
openocd+libswd-c882cb089477050eb46f5f9fba90ff52179acd71.tar.xz
openocd+libswd-c882cb089477050eb46f5f9fba90ff52179acd71.zip
- added autoprobe functionality
- corrected blocksize handling from GDB "info mem" command (thanks to Øyvind and Spen for these patches) git-svn-id: svn://svn.berlios.de/openocd/trunk@278 b42882b7-edfa-0310-969c-e2dbd0fdcd60
Diffstat (limited to 'src/flash/stellaris.c')
-rw-r--r--src/flash/stellaris.c14
1 files changed, 14 insertions, 0 deletions
diff --git a/src/flash/stellaris.c b/src/flash/stellaris.c
index 60dd96b0..b944c34e 100644
--- a/src/flash/stellaris.c
+++ b/src/flash/stellaris.c
@@ -49,6 +49,7 @@ int stellaris_flash_bank_command(struct command_context_s *cmd_ctx, char *cmd, c
int stellaris_erase(struct flash_bank_s *bank, int first, int last);
int stellaris_protect(struct flash_bank_s *bank, int set, int first, int last);
int stellaris_write(struct flash_bank_s *bank, u8 *buffer, u32 offset, u32 count);
+int stellaris_auto_probe(struct flash_bank_s *bank);
int stellaris_probe(struct flash_bank_s *bank);
int stellaris_erase_check(struct flash_bank_s *bank);
int stellaris_protect_check(struct flash_bank_s *bank);
@@ -70,6 +71,7 @@ flash_driver_t stellaris_flash =
.protect = stellaris_protect,
.write = stellaris_write,
.probe = stellaris_probe,
+ .auto_probe = stellaris_auto_probe,
.erase_check = stellaris_erase_check,
.protect_check = stellaris_protect_check,
.info = stellaris_info
@@ -916,6 +918,8 @@ int stellaris_probe(struct flash_bank_s *bank)
*/
stellaris_flash_bank_t *stellaris_info = bank->driver_priv;
+ stellaris_info->probed = 0;
+
if (stellaris_info->did1 == 0)
{
stellaris_read_part_info(bank);
@@ -927,5 +931,15 @@ int stellaris_probe(struct flash_bank_s *bank)
return ERROR_FLASH_OPERATION_FAILED;
}
+ stellaris_info->probed = 1;
+
return ERROR_OK;
}
+
+int stellaris_auto_probe(struct flash_bank_s *bank)
+{
+ stellaris_flash_bank_t *stellaris_info = bank->driver_priv;
+ if (stellaris_info->probed)
+ return ERROR_OK;
+ return stellaris_probe(bank);
+}