X-Git-Url: https://review.openocd.org/gitweb?a=blobdiff_plain;f=src%2Fecosboard.c;h=8d85fe61bcd24f70b05758767e513650fdeef97f;hb=55926f576f99a0c67b2836fedf0dc1bfc1260428;hp=78623ae096a77a0732d3ffd5097e2eeb7825cb9e;hpb=8b994145b849c40b0a195c3fb332b9770b2f9097;p=openocd.git diff --git a/src/ecosboard.c b/src/ecosboard.c index 78623ae096..8d85fe61bc 100644 --- a/src/ecosboard.c +++ b/src/ecosboard.c @@ -114,7 +114,7 @@ static bool writeLog = true; char hwaddr[512]; -extern flash_driver_t *flash_drivers[]; +extern struct flash_driver *flash_drivers[]; extern target_type_t *target_types[]; #ifdef CYGPKG_PROFILE_GPROF @@ -155,8 +155,8 @@ static char reboot_stack[2048]; static void zylinjtag_reboot(cyg_addrword_t data) { serialLog = true; - diag_printf("Rebooting in 100 ticks..\n"); - cyg_thread_delay(100); + diag_printf("Rebooting in 500 ticks..\n"); + cyg_thread_delay(500); diag_printf("Unmounting /config..\n"); umount("/config"); diag_printf("Rebooting..\n"); @@ -328,6 +328,7 @@ void openocd_sleep_postlude(void) void format(void) { +#ifdef CYGDAT_IO_FLASH_BLOCK_DEVICE_NAME_1 diag_printf("Formatting JFFS2...\n"); cyg_io_handle_t handle; @@ -365,6 +366,7 @@ void format(void) } diag_printf("Flash formatted successfully\n"); +#endif reboot(); } @@ -472,7 +474,6 @@ static int zylinjtag_Jim_Command_reboot(Jim_Interp *interp, int argc, return JIM_OK; } - static void zylinjtag_startNetwork(void) { // Bring TCP/IP up immediately before we're ready to accept commands. @@ -503,7 +504,7 @@ static void zylinjtag_startNetwork(void) Jim_CreateCommand(httpstate.jim_interp, "log", zylinjtag_Jim_Command_log, NULL, NULL); - Jim_CreateCommand(httpstate.jim_interp, "reboot", + Jim_CreateCommand(httpstate.jim_interp, "zy1000_reboot", zylinjtag_Jim_Command_reboot, NULL, NULL); Jim_CreateCommand(httpstate.jim_interp, "threads", zylinjtag_Jim_Command_threads, NULL, NULL); @@ -589,6 +590,7 @@ static void print_exception_handler(cyg_addrword_t data, cyg_code_t exception, } +#ifdef CYGNUM_HAL_VECTOR_UNDEF_INSTRUCTION static void setHandler(cyg_code_t exception) { cyg_exception_handler_t *old_handler; @@ -597,6 +599,7 @@ static void setHandler(cyg_code_t exception) cyg_exception_set_handler(exception, print_exception_handler, 0, &old_handler, &old_data); } +#endif static cyg_thread zylinjtag_uart_thread_object; static cyg_handle_t zylinjtag_uart_thread_handle; @@ -623,6 +626,9 @@ void setNoDelay(int session, int flag) #endif } +#define TEST_TCPIP() 0 + +#if TEST_TCPIP struct { int req; @@ -631,6 +637,7 @@ struct int actual2; } tcpipSent[512 * 1024]; int cur; +#endif static void zylinjtag_uart(cyg_addrword_t data) { @@ -695,7 +702,9 @@ static void zylinjtag_uart(cyg_addrword_t data) size_t pos, pos2; pos = 0; pos2 = 0; +#if TEST_TCPIP cur = 0; +#endif for (;;) { fd_set write_fds; @@ -740,7 +749,6 @@ static void zylinjtag_uart(cyg_addrword_t data) pos2 = 0; } - size_t x = actual2; size_t y = 0; if (actual2 > 0) { @@ -770,7 +778,6 @@ static void zylinjtag_uart(cyg_addrword_t data) actual += t; } - int x2 = actual; int y2 = 0; if (actual > 0) { @@ -796,6 +803,7 @@ static void zylinjtag_uart(cyg_addrword_t data) } y2 = written; } +#if TEST_TCPIP if (cur < 1024) { tcpipSent[cur].req = x; @@ -804,11 +812,12 @@ static void zylinjtag_uart(cyg_addrword_t data) tcpipSent[cur].actual2 = y2; cur++; } - +#endif } closeSession: close(session); close(serHandle); +#if TEST_TCPIP int i; for (i = 0; i < 1024; i++) { @@ -816,6 +825,7 @@ static void zylinjtag_uart(cyg_addrword_t data) tcpipSent[i].req2, tcpipSent[i].actual2); } +#endif } close(fd); @@ -918,7 +928,7 @@ command_context_t *setup_command_handler(void); static const char *zylin_config_dir="/config/settings"; -int add_default_dirs(void) +static int add_default_dirs(void) { add_script_search_dir(zylin_config_dir); add_script_search_dir("/rom/lib/openocd");