diff --git a/src/flash/at91sam7.c b/src/flash/at91sam7.c index 8491682966f5b08e4b5da7259d7e1e5d42c78fcf..dc9c2d724c0f96194cd59b397628665667c4326d 100644 --- a/src/flash/at91sam7.c +++ b/src/flash/at91sam7.c @@ -405,6 +405,40 @@ int at91sam7_read_part_info(struct flash_bank_s *bank) return ERROR_OK; } + if (at91sam7_info->cidr_arch == 0x72 ) + { + at91sam7_info->num_nvmbits = 2; + at91sam7_info->nvmbits = (status>>8)&0x03; + bank->base = 0x100000; + bank->bus_width = 4; + if (bank->size==0x80000) /* AT91SAM7SE512 */ + { + at91sam7_info->target_name = "AT91SAM7SE512"; + at91sam7_info->num_lockbits = 32; + at91sam7_info->pagesize = 256; + at91sam7_info->pages_in_lockregion = 64; + at91sam7_info->num_pages = 32*64; + } + if (bank->size==0x40000) + { + at91sam7_info->target_name = "AT91SAM7SE256"; + at91sam7_info->num_lockbits = 16; + at91sam7_info->pagesize = 256; + at91sam7_info->pages_in_lockregion = 64; + at91sam7_info->num_pages = 16*64; + } + if (bank->size==0x08000) + { + at91sam7_info->target_name = "AT91SAM7SE32"; + at91sam7_info->num_lockbits = 8; + at91sam7_info->pagesize = 128; + at91sam7_info->pages_in_lockregion = 32; + at91sam7_info->num_pages = 8*32; + } + + return ERROR_OK; + } + if (at91sam7_info->cidr_arch == 0x75 ) { at91sam7_info->num_nvmbits = 3; diff --git a/src/jtag/Makefile.am b/src/jtag/Makefile.am index d4812a468a846ae481654e0816e9be94e411d66a..78230b629c97ebe430e9292e7ad09f53f080f630 100644 --- a/src/jtag/Makefile.am +++ b/src/jtag/Makefile.am @@ -28,14 +28,12 @@ endif if FT2232_LIBFTDI FT2232FILES = ft2232.c else -FT2232FILES = -endif - if FT2232_FTD2XX FT2232FILES = ft2232.c else FT2232FILES = endif +endif if AMTJTAGACCEL AMTJTAGACCELFILES = amt_jtagaccel.c diff --git a/src/jtag/ft2232.c b/src/jtag/ft2232.c index 096111bc8e0fbcc123c41db7c7a93d290089d466..386da249a9dd2c6d9f4a8193c615c3ca6c7af034 100644 --- a/src/jtag/ft2232.c +++ b/src/jtag/ft2232.c @@ -52,13 +52,13 @@ /* enable this to debug io latency */ -#if 1 +#if 0 #define _DEBUG_USB_IO_ #endif /* enable this to debug communication */ -#if 1 +#if 0 #define _DEBUG_USB_COMMS_ #endif diff --git a/src/jtag/jtag.c b/src/jtag/jtag.c index 259a327dd87eb71424c9706ca3218aef95707523..263eed1a931d9ed47b799cfacad79abd75d3ccef 100644 --- a/src/jtag/jtag.c +++ b/src/jtag/jtag.c @@ -714,7 +714,7 @@ int jtag_add_pathmove(int num_states, enum tap_state *path) *last_cmd = cmd_queue_alloc(sizeof(jtag_command_t)); last_comand_pointer = &((*last_cmd)->next); (*last_cmd)->next = NULL; - (*last_cmd)->type = JTAG_RUNTEST; + (*last_cmd)->type = JTAG_PATHMOVE; (*last_cmd)->cmd.pathmove = cmd_queue_alloc(sizeof(pathmove_command_t)); (*last_cmd)->cmd.pathmove->num_states = num_states; diff --git a/src/jtag/parport.c b/src/jtag/parport.c index c87f98e4ae6a5ed5eeb9b2e10fb6361429e098b7..8278bda9aabf25e8061b092e2d2fe81a9dbab7b5 100644 --- a/src/jtag/parport.c +++ b/src/jtag/parport.c @@ -98,6 +98,7 @@ cable_t cables[] = { "chameleon", 0x80, 0x00, 0x04, 0x01, 0x02, 0x00, 0x00, 0x80, 0x00 }, { "dlc5", 0x10, 0x00, 0x04, 0x02, 0x01, 0x00, 0x00, 0x00, 0x10 }, { "triton", 0x80, 0x08, 0x04, 0x01, 0x02, 0x00, 0x00, 0x80, 0x00 }, + { "lattice", 0x40, 0x10, 0x04, 0x02, 0x01, 0x08, 0x00, 0x00, 0x18 }, { NULL, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 } }; @@ -311,7 +312,7 @@ int parport_init(void) dataport_value = cable->PORT_INIT; #if PARPORT_USE_PPDEV == 1 - if (device_handle>0) + if (device_handle > 0) { ERROR("device is already opened"); return ERROR_JTAG_INIT_FAILED; @@ -322,13 +323,14 @@ int parport_init(void) snprintf(buffer, 256, "/dev/ppi%d", parport_port); device_handle = open(buffer, O_WRONLY); -#else +#else /* not __Free_BSD */ DEBUG("opening /dev/parport%d...", parport_port); snprintf(buffer, 256, "/dev/parport%d", parport_port); device_handle = open(buffer, O_WRONLY); -#endif - if (device_handle<0) +#endif /* __FreeBSD__ */ + + if (device_handle < 0) { ERROR("cannot open device. check it exists and that user read and write rights are set"); return ERROR_JTAG_INIT_FAILED; @@ -359,8 +361,9 @@ int parport_init(void) ERROR("cannot set compatible 1284 mode to device"); return ERROR_JTAG_INIT_FAILED; } -#endif -#else +#endif /* not __Free_BSD__ */ + +#else /* not PARPORT_USE_PPDEV */ if (parport_port == 0) { parport_port = 0x378; @@ -381,6 +384,14 @@ int parport_init(void) return ERROR_JTAG_INIT_FAILED; } DEBUG("...privileges granted"); + + /* make sure parallel port is in right mode (clear tristate and interrupt */ + #ifdef __FreeBSD__ + outb(parport_port + 2, 0x0); + #else + outb(0x0, dataport); + #endif + #endif /* PARPORT_USE_PPDEV */ parport_reset(0, 0); diff --git a/src/server/gdb_server.c b/src/server/gdb_server.c index 97f5fbfa6ee3deadd0a923dbb50a7ef20cd45b6a..10e3676718a750fbe09d795c571e5e5c4bfa1c9f 100644 --- a/src/server/gdb_server.c +++ b/src/server/gdb_server.c @@ -98,7 +98,7 @@ int gdb_get_char(connection_t *connection, int* next_char) case WSAECONNABORTED: return ERROR_SERVER_REMOTE_CLOSED; default: - ERROR("read: %d", strerror(errno)); + ERROR("read: %d", errno); exit(-1); } #else diff --git a/src/target/arm_disassembler.c b/src/target/arm_disassembler.c index 090241027b399dc46c89444a67484c143a20ac7c..8a048cfccb2f1d159dc35be7a4291a54f4081739 100644 --- a/src/target/arm_disassembler.c +++ b/src/target/arm_disassembler.c @@ -1247,7 +1247,7 @@ int evaluate_opcode(u32 opcode, u32 address, arm_instruction_t *instruction) } /* catch opcodes with [27:25] = b011 */ - if ((opcode & 0x0e000000) == 0x04000000) + if ((opcode & 0x0e000000) == 0x06000000) { /* Undefined instruction */ if ((opcode & 0x00000010) == 0x00000010)