diff options
author | ntfreak <ntfreak@b42882b7-edfa-0310-969c-e2dbd0fdcd60> | 2009-07-20 07:03:11 +0000 |
---|---|---|
committer | ntfreak <ntfreak@b42882b7-edfa-0310-969c-e2dbd0fdcd60> | 2009-07-20 07:03:11 +0000 |
commit | 55b1ea1d8e4558e68a58f33a9900163605f8333f (patch) | |
tree | c025c67479227267e2ebef3ca96ca1d92c4c75f0 /src/flash | |
parent | f703322b3f9f537a565cfb6eb028528287baa5d9 (diff) | |
download | openocd+libswd-55b1ea1d8e4558e68a58f33a9900163605f8333f.tar.gz openocd+libswd-55b1ea1d8e4558e68a58f33a9900163605f8333f.tar.bz2 openocd+libswd-55b1ea1d8e4558e68a58f33a9900163605f8333f.tar.xz openocd+libswd-55b1ea1d8e4558e68a58f33a9900163605f8333f.zip |
- fix issue with reading device id, bug appeared when flash_address code was added
- fix issue when multiple flash chips are connected, eg. x16 x 2 on 32bit mcu bus
git-svn-id: svn://svn.berlios.de/openocd/trunk@2551 b42882b7-edfa-0310-969c-e2dbd0fdcd60
Diffstat (limited to 'src/flash')
-rw-r--r-- | src/flash/cfi.c | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/src/flash/cfi.c b/src/flash/cfi.c index 8ead2082..4afc58be 100644 --- a/src/flash/cfi.c +++ b/src/flash/cfi.c @@ -2172,7 +2172,7 @@ static int cfi_probe(struct flash_bank_s *bank) { return retval; } - if ((retval = target_read_u16(target, flash_address(bank, 0, 0x02), &cfi_info->device_id)) != ERROR_OK) + if ((retval = target_read_u16(target, flash_address(bank, 0, 0x01), &cfi_info->device_id)) != ERROR_OK) { return retval; } @@ -2383,9 +2383,10 @@ static int cfi_probe(struct flash_bank_s *bank) sector++; } } - if (offset != cfi_info->dev_size) + if (offset != (cfi_info->dev_size * bank->bus_width / bank->chip_width)) { - LOG_WARNING("CFI size is 0x%" PRIx32 ", but total sector size is 0x%" PRIx32 "", cfi_info->dev_size, offset); + LOG_WARNING("CFI size is 0x%" PRIx32 ", but total sector size is 0x%" PRIx32 "", \ + (cfi_info->dev_size * bank->bus_width / bank->chip_width), offset); } } |