From: Øyvind H. <go...@us...> - 2009-11-17 15:59:45
|
This is an automated email from the git hooks/post-receive script. It was generated because a ref change was pushed to the repository containing the project "Main OpenOCD repository". The branch, master has been updated via 959b373f8cdc2c1ad11c67c6916f88f48769438f (commit) via 741cd3c3ab172e6231fc5ed2d099993d59315f74 (commit) via ca32f25638408df8a9c18522da43f6e8adcdb5cb (commit) via 83104648e6a1834244eb1b1bb6324f729532906c (commit) from b888b63fe9bee26e567a645f6ceb10d66bfff785 (commit) Those revisions listed above that are new to this repository have not appeared on any other notification email; so we list those revisions in full, below. - Log ----------------------------------------------------------------- commit 959b373f8cdc2c1ad11c67c6916f88f48769438f Author: Ãyvind Harboe <oyv...@zy...> Date: Tue Nov 17 11:03:55 2009 +0100 jtag_registers: Avalon bridge flushing tweaks The code is now much more explicit. It flushes every N writes. For now flush every time, but tinkering with the bridge FIFO size and how often we flush clearly points in the direction of the Avalon write FIFO full being the culprit. Signed-off-by: Ãyvind Harboe <oyv...@zy...> diff --git a/src/jtag/zy1000/jtag_minidriver.h b/src/jtag/zy1000/jtag_minidriver.h index 3fe16ef..afbea13 100644 --- a/src/jtag/zy1000/jtag_minidriver.h +++ b/src/jtag/zy1000/jtag_minidriver.h @@ -30,8 +30,19 @@ int diag_printf(const char *fmt, ...); #define ZY1000_POKE(a, b) HAL_WRITE_UINT32(a, b); diag_printf("poke 0x%08x,0x%08x\n", a, b) #define ZY1000_PEEK(a, b) HAL_READ_UINT32(a, b); diag_printf("peek 0x%08x = 0x%08x\n", a, b) #else -#define ZY1000_POKE(a, b) HAL_WRITE_UINT32(a, b) #define ZY1000_PEEK(a, b) HAL_READ_UINT32(a, b) +#define ZY1000_POKE(a, b) HAL_WRITE_UINT32(a, b);\ + {/* This will flush the bridge FIFO. Overflowed bridge FIFO fails. We must \ + flush every "often". No precise system has been found, but 4 seems solid. \ + */ \ + static int overflow_counter = 0; \ + if (++overflow_counter >= 1) \ + { \ + /* clear FIFO */ \ + cyg_uint32 empty; ZY1000_PEEK(ZY1000_JTAG_BASE + 0x10, empty); \ + overflow_counter = 0; \ + } \ + } #endif // FIFO empty? commit 741cd3c3ab172e6231fc5ed2d099993d59315f74 Author: Ãyvind Harboe <oyv...@zy...> Date: Tue Nov 17 11:00:02 2009 +0100 zy1000: revC UART forwarding Name of serial device differs between revB/C. Signed-off-by: Ãyvind Harboe <oyv...@zy...> diff --git a/src/ecosboard.c b/src/ecosboard.c index 0cbba3e..120b3f9 100644 --- a/src/ecosboard.c +++ b/src/ecosboard.c @@ -1,5 +1,5 @@ /*************************************************************************** - * Copyright (C) 2007-2008 by Ãyvind Harboe * + * Copyright (C) 2007-2009 by Ãyvind Harboe * * * * This program is free software; you can redistribute it and/or modify * * it under the terms of the GNU General Public License as published by * @@ -81,6 +81,14 @@ #include <stdio.h> +#ifdef CYGPKG_HAL_NIOS2 +#define ZY1000_SER_DEV "/dev/uart_0" +#else +#define ZY1000_SER_DEV "/dev/ser0" + +#endif + + #define MAX_IFS 64 #if defined(CYGPKG_NET_FREEBSD_STACK) #include <tftp_support.h> @@ -684,7 +692,7 @@ static void zylinjtag_uart(cyg_addrword_t data) int oldopts = fcntl(session, F_GETFL, 0); fcntl(session, F_SETFL, oldopts | O_NONBLOCK); // - int serHandle = open("/dev/ser0", O_RDWR | O_NONBLOCK); + int serHandle = open(ZY1000_SER_DEV, O_RDWR | O_NONBLOCK); if (serHandle < 0) { close(session); @@ -886,10 +894,10 @@ int handle_uart_command(struct command_context *cmd_ctx, char *cmd, int err; cyg_io_handle_t serial_handle; - err = cyg_io_lookup("/dev/ser0", &serial_handle); + err = cyg_io_lookup(ZY1000_SER_DEV, &serial_handle); if (err != ENOERR) { - LOG_ERROR("/dev/ser0 not found\n"); + LOG_ERROR("Could not open serial port\n"); return ERROR_FAIL; } commit ca32f25638408df8a9c18522da43f6e8adcdb5cb Author: Ãyvind Harboe <oyv...@zy...> Date: Fri Nov 13 13:54:20 2009 +0100 zy1000: add version command to print FPGA version and timestamps Signed-off-by: Ãyvind Harboe <oyv...@zy...> diff --git a/src/jtag/zy1000/zy1000.c b/src/jtag/zy1000/zy1000.c index f2a5aa9..a509aee 100644 --- a/src/jtag/zy1000/zy1000.c +++ b/src/jtag/zy1000/zy1000.c @@ -28,6 +28,8 @@ #include <cyg/hal/hal_io.h> // low level i/o #include <cyg/hal/hal_diag.h> +#include <time.h> + #define ZYLIN_VERSION GIT_ZY1000_VERSION #define ZYLIN_DATE __DATE__ #define ZYLIN_TIME __TIME__ @@ -257,9 +259,8 @@ int handle_power_command(struct command_context *cmd_ctx, char *cmd, char **args /* Give TELNET a way to find out what version this is */ static int jim_zy1000_version(Jim_Interp *interp, int argc, Jim_Obj *const *argv) { - if ((argc < 1) || (argc > 2)) + if ((argc < 1) || (argc > 3)) return JIM_ERR; - char buff[128]; const char *version_str = NULL; if (argc == 1) @@ -268,6 +269,9 @@ static int jim_zy1000_version(Jim_Interp *interp, int argc, Jim_Obj *const *argv } else { const char *str = Jim_GetString(argv[1], NULL); + const char *str2 = NULL; + if (argc > 2) + str2 = Jim_GetString(argv[2], NULL); if (strcmp("openocd", str) == 0) { version_str = ZYLIN_OPENOCD; @@ -292,6 +296,29 @@ static int jim_zy1000_version(Jim_Interp *interp, int argc, Jim_Obj *const *argv version_str="b"; #endif } +#ifdef CYGPKG_HAL_NIOS2 + else if (strcmp("fpga", str) == 0) + { + + /* return a list of 32 bit integers to describe the expected + * and actual FPGA + */ + static char *fpga_id = "0x12345678 0x12345678 0x12345678 0x12345678"; + cyg_uint32 id, timestamp; + HAL_READ_UINT32(SYSID_BASE, id); + HAL_READ_UINT32(SYSID_BASE+4, timestamp); + sprintf(fpga_id, "0x%08x 0x%08x 0x%08x 0x%08x", id, timestamp, SYSID_ID, SYSID_TIMESTAMP); + version_str = fpga_id; + if ((argc>2) && (strcmp("time", str2) == 0)) + { + time_t last_mod = timestamp; + char * t = ctime (&last_mod) ; + t[strlen(t)-1] = 0; + version_str = t; + } + } +#endif + else { return JIM_ERR; commit 83104648e6a1834244eb1b1bb6324f729532906c Author: Ãyvind Harboe <oyv...@zy...> Date: Thu Nov 12 10:10:11 2009 +0100 zy1000: fix bug when running on non-arm CPU Shifting by more than 32 is undefined for 32 bit integers according to the C standard. Robust solution is conditional code. Signed-off-by: Ãyvind Harboe <oyv...@zy...> diff --git a/src/jtag/zy1000/zy1000.c b/src/jtag/zy1000/zy1000.c index 9a5d2e7..f2a5aa9 100644 --- a/src/jtag/zy1000/zy1000.c +++ b/src/jtag/zy1000/zy1000.c @@ -509,7 +509,14 @@ static __inline void scanFields(int num_fields, const struct scan_field *fields, } } /* mask away unused bits for easier debugging */ - value&=~(((uint32_t)0xffffffff) << k); + if (k < 32) + { + value&=~(((uint32_t)0xffffffff) << k); + } else + { + /* Shifting by >= 32 is not defined by the C standard + * and will in fact shift by &0x1f bits on nios */ + } shiftValueInner(shiftState, pause_state, k, value); ----------------------------------------------------------------------- Summary of changes: src/ecosboard.c | 16 +++++++++++--- src/jtag/zy1000/jtag_minidriver.h | 13 +++++++++++- src/jtag/zy1000/zy1000.c | 40 ++++++++++++++++++++++++++++++++++-- 3 files changed, 61 insertions(+), 8 deletions(-) hooks/post-receive -- Main OpenOCD repository |