X-Git-Url: https://review.openocd.org/gitweb?p=openocd.git;a=blobdiff_plain;f=src%2Fecosboard.c;h=120b3f91e796cf97bc4d08b886dec87326c8f594;hp=e38316cb7f6045fcf2b7db608311552a674eaa5e;hb=9e9633c6b98cc9243ae78cd12ab657d041eaa73e;hpb=4088b1e622cff0673f2859de5ee611da736bdba7 diff --git a/src/ecosboard.c b/src/ecosboard.c index e38316cb7f..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,18 +21,14 @@ #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" @@ -85,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 @@ -688,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); @@ -890,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; }