- correctly mask out bits that aren't part of a copied buffer
authordrath <drath@b42882b7-edfa-0310-969c-e2dbd0fdcd60>
Thu, 12 Apr 2007 13:27:23 +0000 (13:27 +0000)
committerdrath <drath@b42882b7-edfa-0310-969c-e2dbd0fdcd60>
Thu, 12 Apr 2007 13:27:23 +0000 (13:27 +0000)
- fixed arm926ej-s CP15 register access handling
- correctly identify SYSCLK source in LPC3180 NAND flash controller driver

git-svn-id: svn://svn.berlios.de/openocd/trunk@139 b42882b7-edfa-0310-969c-e2dbd0fdcd60

src/flash/lpc3180_nand_controller.c
src/helper/binarybuffer.c
src/target/arm926ejs.c

index aae5cbbfb17836be017598c0fa2f32da7abbbef5..2ef6f40b6cdc361a6f43d16dec6f4e8a8f9d1f34 100644 (file)
@@ -150,7 +150,7 @@ float lpc3180_cycle_time(lpc3180_nand_controller_t *lpc3180_info)
        /* determine current SYSCLK (13'MHz or main oscillator) */ 
        target_read_u32(target, 0x40004050, &sysclk_ctrl);
        
-       if (sysclk_ctrl & 1)
+       if ((sysclk_ctrl & 1) == 0)
                sysclk = lpc3180_info->osc_freq;
        else
                sysclk = 13000;
index 7d41dc73a499efd6689fbcf1131addfa683353a6..acc8237eb08323fcdfab29fbb3623b0a2a061025 100644 (file)
@@ -101,6 +101,12 @@ u8* buf_cpy(u8 *from, u8 *to, int size)
 
        for (i = 0; i < num_bytes; i++)
                to[i] = from[i];
+       
+       /* mask out bits that don't belong to the buffer */     
+       if (size % 8)
+       {
+               to[size / 8] &= (0xff >> (8 - (size % 8)));
+       }
 
        return to;
 }
index 78d128de74e6b4ea36871847e04aeb99906dbc50..ecabfcd697d9bc0b0217f27420aa4157ebcfc68c 100644 (file)
@@ -158,7 +158,7 @@ int arm926ejs_read_cp15(target_t *target, u32 address, u32 *value)
        {
                jtag_add_dr_scan(4, fields, -1);
                jtag_execute_queue();
-       } while ((access & 1) != 1);
+       } while (buf_get_u32(&access, 0, 1) != 1);
 
 #ifdef _DEBUG_INSTRUCTION_EXECUTION_
        DEBUG("addr: 0x%x value: %8.8x", address, *value);
@@ -234,7 +234,7 @@ int arm926ejs_write_cp15(target_t *target, u32 address, u32 value)
        {
                jtag_add_dr_scan(4, fields, -1);
                jtag_execute_queue();
-       } while (access != 1);
+       } while (buf_get_u32(&access, 0, 1) != 1);
 
 #ifdef _DEBUG_INSTRUCTION_EXECUTION_
        DEBUG("addr: 0x%x value: %8.8x", address, value);

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)