]> git.sur5r.net Git - openocd/commitdiff
- several small fixes (thanks to Magnus Lundin and Spencer Oliver)
authordrath <drath@b42882b7-edfa-0310-969c-e2dbd0fdcd60>
Mon, 23 Oct 2006 14:02:34 +0000 (14:02 +0000)
committerdrath <drath@b42882b7-edfa-0310-969c-e2dbd0fdcd60>
Mon, 23 Oct 2006 14:02:34 +0000 (14:02 +0000)
- added support for using Luminary Micro development board 'evb_lm3s811' as a JTAG interface (thanks to Magnus Lundin)

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

src/flash/str9x.c
src/jtag/ft2232.c
src/jtag/jtag.c
src/target/arm7_9_common.c
src/target/arm7tdmi.c

index 054f5d0a886c1cd1dcab406922be32abf45083fc..c07bc757f1814a131c00c66cad2cf36511c67593 100644 (file)
@@ -107,7 +107,7 @@ int str9x_build_block_list(struct flash_bank_s *bank)
                        exit(-1);
        }
        
-       num_sectors = b0_sectors + 2;
+       num_sectors = b0_sectors + 4;
        
        bank->num_sectors = num_sectors;
        bank->sectors = malloc(sizeof(flash_sector_t) * num_sectors);
@@ -510,7 +510,7 @@ int str9x_write(struct flash_bank_s *bank, u8 *buffer, u32 offset, u32 count)
 
        while (words_remaining > 0)
        {
-               bank_adr = address & 0x03;
+               bank_adr = address & ~0x03;
                
                /* write data command */
                target_write_u16(target, bank_adr, 0x40);
@@ -552,7 +552,7 @@ int str9x_write(struct flash_bank_s *bank, u8 *buffer, u32 offset, u32 count)
                        bytes_written++;
                }
                
-               bank_adr = address & 0x03;
+               bank_adr = address & ~0x03;
                
                /* write data comamnd */
                target_write_u16(target, bank_adr, 0x40);
index 06b419a06cde8fa7898ebbba1af3218fae035ffa..e681b3e5ad843d6294ea95ffeb7a7b2403d20e65 100644 (file)
@@ -109,6 +109,7 @@ ft2232_layout_t ft2232_layouts[] =
        {"jtagkey", jtagkey_init, jtagkey_reset, NULL},
        {"jtagkey_prototype_v1", jtagkey_init, jtagkey_reset, NULL},
        {"signalyzer", usbjtag_init, usbjtag_reset, NULL},
+       {"evb_lm3s811", usbjtag_init, usbjtag_reset, NULL},
        {"olimex-jtag", olimex_jtag_init, olimex_jtag_reset, olimex_jtag_blink},
        {"m5960", m5960_init, m5960_reset, NULL},
        {NULL, NULL, NULL},
@@ -1169,6 +1170,15 @@ int usbjtag_init(void)
                nSRST = 0x20;
                nSRSTnOE = 0x20;
        }
+       else if (strcmp(ft2232_layout, "evb_lm3s811") == 0)
+       {
+               nTRST = 0x0;
+               nTRSTnOE = 0x00;
+               nSRST = 0x20;
+               nSRSTnOE = 0x20;
+               low_output = 0x88;
+               low_direction = 0x8b;
+       }
        else
        {
                ERROR("BUG: usbjtag_init called for unknown layout '%s'", ft2232_layout);
index 5ae7462163f4b5c2c8d2b7575b6439fcba032954..4ba227c09b39b1d3480625609ac66e7c6b4ed1e4 100644 (file)
@@ -1028,7 +1028,6 @@ int jtag_read_buffer(u8 *buffer, scan_command_t *cmd)
 
                        if (cmd->fields[i].in_check_value)
                        {
-                               u8 *captured = buf_set_buf(buffer, bit_count, malloc(CEIL(num_bits, 8)), 0, num_bits);
                                if ((cmd->fields[i].in_check_mask && buf_cmp_mask(captured, cmd->fields[i].in_check_value, cmd->fields[i].in_check_mask, num_bits))
                                        || (!cmd->fields[i].in_check_mask && buf_cmp(captured, cmd->fields[i].in_check_mask, num_bits)))
                                {
index b793ba51531a1b359b48bb58edcc178b4487b921..c298c904e1d222e09957a1a280f8c987ff091a1b 100644 (file)
@@ -281,15 +281,15 @@ int arm7_9_add_breakpoint(struct target_s *target, u32 address, u32 length, enum
                return ERROR_TARGET_RESOURCE_NOT_AVAILABLE;
        }
        
-       if (type == BKPT_HARD)
-               arm7_9->wp_available--;
-       
        if ((length != 2) && (length != 4))
        {
                INFO("only breakpoints of two (Thumb) or four (ARM) bytes length supported");
                return ERROR_TARGET_RESOURCE_NOT_AVAILABLE;
        }
        
+       if (type == BKPT_HARD)
+               arm7_9->wp_available--;
+       
        return ERROR_OK;
 }
 
@@ -1448,7 +1448,7 @@ int arm7_9_step(struct target_s *target, int current, u32 address, int handle_br
 {
        armv4_5_common_t *armv4_5 = target->arch_info;
        arm7_9_common_t *arm7_9 = armv4_5->arch_info;
-       breakpoint_t *breakpoint = target->breakpoints;
+       breakpoint_t *breakpoint = NULL;
 
        if (target->state != TARGET_HALTED)
        {
index 115952446a8c9059d1d0b09e0414209db4edd10d..a1fde037e101d08ba88cd8176941dc743c4e9714 100644 (file)
@@ -869,7 +869,7 @@ int arm7tdmi_target_command(struct command_context_s *cmd_ctx, char *cmd, char *
                exit(-1);
        }
        
-       chain_pos = strtoul(args[2], NULL, 0);
+       chain_pos = strtoul(args[3], NULL, 0);
        
        if (argc >= 5)
                variant = args[4];