lpc288x: Can now use target_write_buffer() 87/1687/2
authorAndreas Fritiofson <andreas.fritiofson@gmail.com>
Fri, 4 Oct 2013 22:24:28 +0000 (00:24 +0200)
committerSpencer Oliver <spen@spen-soft.co.uk>
Tue, 15 Oct 2013 20:41:31 +0000 (20:41 +0000)
Use the preferred code path according to the comment. Target_write_buffer()
now simply uses suitably aligned target_write_memory calls, so from this
pov, they should be equivalent.

Change-Id: I77f51ec3ac9faa822cf428708a1aecb67c77830c
Signed-off-by: Andreas Fritiofson <andreas.fritiofson@gmail.com>
Reviewed-on: http://openocd.zylin.com/1687
Tested-by: jenkins
Reviewed-by: Spencer Oliver <spen@spen-soft.co.uk>
src/flash/nor/lpc288x.c

index 57107658861e98dd8e5717d75c00f352dcad9450..b602619d8e56c24ac852f0e5a3f9af09b038afa7 100644 (file)
@@ -350,22 +350,13 @@ static int lpc288x_write(struct flash_bank *bank, uint8_t *buffer, uint32_t offs
                        target_write_u32(target, F_CTRL, FC_CS | FC_SET_DATA | FC_WEN | FC_FUNC);
 
                        target_write_u32(target, F_CTRL, FC_CS | FC_WEN | FC_FUNC);
                        target_write_u32(target, F_CTRL, FC_CS | FC_SET_DATA | FC_WEN | FC_FUNC);
 
                        target_write_u32(target, F_CTRL, FC_CS | FC_WEN | FC_FUNC);
-                       /*would be better to use the clean target_write_buffer() interface but
-                        * it seems not to be a LOT slower....
-                        * bulk_write_memory() is no quicker :(*/
-#if 1
-                       if (target_write_memory(target, offset + dest_offset, 4, 128,
-                                       page_buffer) != ERROR_OK) {
-                               LOG_ERROR("Write failed s %" PRIx32 " p %" PRIx32 "", sector, page);
-                               return ERROR_FLASH_OPERATION_FAILED;
-                       }
-#else
+
                        if (target_write_buffer(target, offset + dest_offset, FLASH_PAGE_SIZE,
                                        page_buffer) != ERROR_OK) {
                                LOG_INFO("Write to flash buffer failed");
                                return ERROR_FLASH_OPERATION_FAILED;
                        }
                        if (target_write_buffer(target, offset + dest_offset, FLASH_PAGE_SIZE,
                                        page_buffer) != ERROR_OK) {
                                LOG_INFO("Write to flash buffer failed");
                                return ERROR_FLASH_OPERATION_FAILED;
                        }
-#endif
+
                        dest_offset += FLASH_PAGE_SIZE;
                        source_offset += count;
                        bytes_remaining -= count;
                        dest_offset += FLASH_PAGE_SIZE;
                        source_offset += count;
                        bytes_remaining -= count;

Linking to existing account procedure

If you already have an account and want to add another login method you MUST first sign in with your existing account and then change URL to read https://review.openocd.org/login/?link to get to this page again but this time it'll work for linking. Thank you.

SSH host keys fingerprints

1024 SHA256:YKx8b7u5ZWdcbp7/4AeXNaqElP49m6QrwfXaqQGJAOk gerrit-code-review@openocd.zylin.com (DSA)
384 SHA256:jHIbSQa4REvwCFG4cq5LBlBLxmxSqelQPem/EXIrxjk gerrit-code-review@openocd.org (ECDSA)
521 SHA256:UAOPYkU9Fjtcao0Ul/Rrlnj/OsQvt+pgdYSZ4jOYdgs gerrit-code-review@openocd.org (ECDSA)
256 SHA256:A13M5QlnozFOvTllybRZH6vm7iSt0XLxbA48yfc2yfY gerrit-code-review@openocd.org (ECDSA)
256 SHA256:spYMBqEYoAOtK7yZBrcwE8ZpYt6b68Cfh9yEVetvbXg gerrit-code-review@openocd.org (ED25519)
+--[ED25519 256]--+
|=..              |
|+o..   .         |
|*.o   . .        |
|+B . . .         |
|Bo. = o S        |
|Oo.+ + =         |
|oB=.* = . o      |
| =+=.+   + E     |
|. .=o   . o      |
+----[SHA256]-----+
2048 SHA256:0Onrb7/PHjpo6iVZ7xQX2riKN83FJ3KGU0TvI0TaFG4 gerrit-code-review@openocd.zylin.com (RSA)