From c882cb089477050eb46f5f9fba90ff52179acd71 Mon Sep 17 00:00:00 2001 From: mifi Date: Sun, 27 Jan 2008 14:05:59 +0000 Subject: - added autoprobe functionality - corrected blocksize handling from GDB "info mem" command (thanks to Øyvind and Spen for these patches) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit git-svn-id: svn://svn.berlios.de/openocd/trunk@278 b42882b7-edfa-0310-969c-e2dbd0fdcd60 --- src/flash/stellaris.c | 14 ++++++++++++++ 1 file changed, 14 insertions(+) (limited to 'src/flash/stellaris.c') 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); +} -- cgit v1.2.3-18-g5258