X-Git-Url: https://review.openocd.org/gitweb?a=blobdiff_plain;f=src%2Fecosboard.c;h=120b3f91e796cf97bc4d08b886dec87326c8f594;hb=cb7dbc1af41068f826246beb53870c01d8973bb8;hp=38f32525abad8d94bf22563f6f0994f24f43a0a7;hpb=98723c4ecdbe06f90c66f3abec27b792c3b38e34;p=openocd.git diff --git a/src/ecosboard.c b/src/ecosboard.c index 38f32525ab..120b3f91e7 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 * @@ -21,21 +21,18 @@ #include "config.h" #endif -#include "log.h" #include "types.h" #include "jtag.h" #include "configuration.h" #include "xsvf.h" #include "svf.h" -#include "target.h" -#include "flash.h" #include "nand.h" #include "pld.h" -#include "command.h" #include "server.h" #include "telnet_server.h" #include "gdb_server.h" +#include "openocd.h" #include #include @@ -84,6 +81,14 @@ #include +#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 @@ -687,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); @@ -889,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; }