Merge pull request #631 from smarsching/xvc-client-without-ftdi
Allow building XVC client without libftdi
This commit is contained in:
commit
d9d6c30eed
|
|
@ -66,11 +66,13 @@ endif()
|
|||
|
||||
# XVC and RemoteBitbang are not available on Windows OS.
|
||||
if (NOT ${CMAKE_SYSTEM_NAME} MATCHES "Windows")
|
||||
option(ENABLE_REMOTEBITBANG "enable remote bitbang driver" ${ENABLE_CABLE_ALL})
|
||||
option(ENABLE_XILINX_VIRTUAL_CABLE "enable Xilinx Virtual Cable (XVC) support" ${ENABLE_CABLE_ALL})
|
||||
option(ENABLE_REMOTEBITBANG "enable remote bitbang driver" ${ENABLE_CABLE_ALL})
|
||||
option(ENABLE_XILINX_VIRTUAL_CABLE_CLIENT "enable Xilinx Virtual Cable (XVC) client support" ${ENABLE_CABLE_ALL})
|
||||
option(ENABLE_XILINX_VIRTUAL_CABLE_SERVER "enable Xilinx Virtual Cable (XVC) server support" ${ENABLE_CABLE_ALL})
|
||||
else()
|
||||
set(ENABLE_REMOTEBITBANG OFF)
|
||||
set(ENABLE_XILINX_VIRTUAL_CABLE OFF)
|
||||
set(ENABLE_REMOTEBITBANG OFF)
|
||||
set(ENABLE_XILINX_VIRTUAL_CABLE_CLIENT OFF)
|
||||
set(ENABLE_XILINX_VIRTUAL_CABLE_SERVER OFF)
|
||||
endif()
|
||||
|
||||
####################################################################################################
|
||||
|
|
@ -102,11 +104,11 @@ set(USE_LIBUSB_LL OFF)
|
|||
|
||||
# Only adds libftdi as dependency when a cable
|
||||
# need this library.
|
||||
if (ENABLE_FTDI_BASED_CABLE OR ENABLE_USB_BLASTERI OR ENABLE_XILINX_VIRTUAL_CABLE)
|
||||
if (ENABLE_FTDI_BASED_CABLE OR ENABLE_USB_BLASTERI OR ENABLE_XILINX_VIRTUAL_CABLE_SERVER)
|
||||
set(USE_LIBFTDI ON)
|
||||
else()
|
||||
message("disabled all cables based on FTDI devices")
|
||||
endif(ENABLE_FTDI_BASED_CABLE OR ENABLE_USB_BLASTERI OR ENABLE_XILINX_VIRTUAL_CABLE)
|
||||
endif(ENABLE_FTDI_BASED_CABLE OR ENABLE_USB_BLASTERI OR ENABLE_XILINX_VIRTUAL_CABLE_SERVER)
|
||||
|
||||
# Only adds libusb as dependency when a cable need this library
|
||||
if (ENABLE_DFU OR ENABLE_ANLOGIC_CABLE OR ENABLE_CH347 OR ENABLE_DIRTYJTAG
|
||||
|
|
@ -591,9 +593,13 @@ add_definitions(-DENABLE_SVF_JTAG)
|
|||
endif()
|
||||
|
||||
# Xilinx Virtual Cable
|
||||
if (ENABLE_XILINX_VIRTUAL_CABLE)
|
||||
list (APPEND OPENFPGALOADER_SOURCE src/xvc_client.cpp src/xvc_server.cpp)
|
||||
list (APPEND OPENFPGALOADER_HEADERS src/xvc_client.hpp src/xvc_server.hpp)
|
||||
if (ENABLE_XILINX_VIRTUAL_CABLE_CLIENT)
|
||||
list (APPEND OPENFPGALOADER_SOURCE src/xvc_client.cpp)
|
||||
list (APPEND OPENFPGALOADER_HEADERS src/xvc_client.hpp)
|
||||
endif()
|
||||
if (ENABLE_XILINX_VIRTUAL_CABLE_SERVER)
|
||||
list (APPEND OPENFPGALOADER_SOURCE src/xvc_server.cpp)
|
||||
list (APPEND OPENFPGALOADER_HEADERS src/xvc_server.hpp)
|
||||
endif()
|
||||
|
||||
# Altera USB Blaster (I & II).
|
||||
|
|
@ -772,8 +778,16 @@ else()
|
|||
message("Remote bitbang client support disabled")
|
||||
endif()
|
||||
|
||||
if (ENABLE_XILINX_VIRTUAL_CABLE)
|
||||
add_definitions(-DENABLE_XVC=1)
|
||||
if (ENABLE_XILINX_VIRTUAL_CABLE_CLIENT)
|
||||
add_definitions(-DENABLE_XVC_CLIENT=1)
|
||||
set(CMAKE_EXE_LINKER_FLAGS "-pthread ${CMAKE_EXE_LINKER_FLAGS}")
|
||||
message("Xilinx Virtual Client support enabled")
|
||||
else()
|
||||
message("Xilinx Virtual Client support disabled")
|
||||
endif()
|
||||
|
||||
if (ENABLE_XILINX_VIRTUAL_CABLE_SERVER)
|
||||
add_definitions(-DENABLE_XVC_SERVER=1)
|
||||
set(CMAKE_EXE_LINKER_FLAGS "-pthread ${CMAKE_EXE_LINKER_FLAGS}")
|
||||
message("Xilinx Virtual Server support enabled")
|
||||
else()
|
||||
|
|
|
|||
|
|
@ -48,5 +48,6 @@ set(CMAKE_EXE_LINKER_FLAGS_INIT "-static -static-libgcc -static-libstdc++")
|
|||
set(ENABLE_UDEV OFF CACHE BOOL "" FORCE)
|
||||
set(ENABLE_LIBGPIOD OFF CACHE BOOL "" FORCE)
|
||||
set(ENABLE_REMOTEBITBANG OFF CACHE BOOL "" FORCE)
|
||||
set(ENABLE_XILINX_VIRTUAL_CABLE OFF CACHE BOOL "" FORCE)
|
||||
set(ENABLE_XILINX_VIRTUAL_CABLE_CLIENT OFF CACHE BOOL "" FORCE)
|
||||
set(ENABLE_XILINX_VIRTUAL_CABLE_SERVER OFF CACHE BOOL "" FORCE)
|
||||
set(BUILD_STATIC ON CACHE BOOL "" FORCE)
|
||||
|
|
|
|||
|
|
@ -35,5 +35,6 @@ set(CMAKE_EXE_LINKER_FLAGS_INIT "-static -static-libgcc -static-libstdc++")
|
|||
set(ENABLE_UDEV OFF CACHE BOOL "" FORCE)
|
||||
set(ENABLE_LIBGPIOD OFF CACHE BOOL "" FORCE)
|
||||
set(ENABLE_REMOTEBITBANG OFF CACHE BOOL "" FORCE)
|
||||
set(ENABLE_XILINX_VIRTUAL_CABLE OFF CACHE BOOL "" FORCE)
|
||||
set(ENABLE_XILINX_VIRTUAL_CABLE_CLIENT OFF CACHE BOOL "" FORCE)
|
||||
set(ENABLE_XILINX_VIRTUAL_CABLE_SERVER OFF CACHE BOOL "" FORCE)
|
||||
set(BUILD_STATIC ON CACHE BOOL "" FORCE)
|
||||
|
|
|
|||
|
|
@ -385,7 +385,8 @@ Example (enable FTDI-based cables and Xilinx devices only):
|
|||
- ``ENABLE_USB_BLASTERII``: Enable Altera USB-Blaster II support.
|
||||
- ``ENABLE_LIBGPIOD``: Enable libgpiod bitbang driver support (Linux only).
|
||||
- ``ENABLE_REMOTEBITBANG``: Enable remote-bitbang driver support.
|
||||
- ``ENABLE_XILINX_VIRTUAL_CABLE``: Enable Xilinx Virtual Cable (XVC) support.
|
||||
- ``ENABLE_XILINX_VIRTUAL_CABLE_CLIENT``: Enable Xilinx Virtual Cable (XVC) client support.
|
||||
- ``ENABLE_XILINX_VIRTUAL_CABLE_SERVER``: Enable Xilinx Virtual Cable (XVC) server support.
|
||||
|
||||
**Vendor options**
|
||||
|
||||
|
|
|
|||
|
|
@ -55,7 +55,7 @@
|
|||
#ifdef ENABLE_USBBLASTER
|
||||
#include "usbBlaster.hpp"
|
||||
#endif
|
||||
#ifdef ENABLE_XVC
|
||||
#ifdef ENABLE_XVC_CLIENT
|
||||
#include "xvc_client.hpp"
|
||||
#endif
|
||||
|
||||
|
|
@ -186,7 +186,7 @@ Jtag::Jtag(const cable_t &cable, const jtag_pins_conf_t *pin_conf,
|
|||
throw std::exception();
|
||||
#endif
|
||||
case MODE_XVC_CLIENT:
|
||||
#ifdef ENABLE_XVC
|
||||
#ifdef ENABLE_XVC_CLIENT
|
||||
_jtag = new XVC_client(ip_adr, port, clkHZ, verbose);
|
||||
break;
|
||||
#else
|
||||
|
|
|
|||
|
|
@ -62,7 +62,7 @@
|
|||
#ifdef ENABLE_SVF_JTAG
|
||||
#include "svf_jtag.hpp"
|
||||
#endif
|
||||
#ifdef ENABLE_XVC
|
||||
#ifdef ENABLE_XVC_SERVER
|
||||
#include "xvc_server.hpp"
|
||||
#endif
|
||||
|
||||
|
|
@ -517,7 +517,7 @@ int main(int argc, char **argv)
|
|||
#endif
|
||||
}
|
||||
|
||||
#ifdef ENABLE_XVC
|
||||
#ifdef ENABLE_XVC_SERVER
|
||||
/* ------------------- */
|
||||
/* XVC server */
|
||||
/* ------------------- */
|
||||
|
|
@ -809,7 +809,7 @@ int main(int argc, char **argv)
|
|||
delete(jtag);
|
||||
}
|
||||
|
||||
#ifdef ENABLE_XVC
|
||||
#ifdef ENABLE_XVC_SERVER
|
||||
int run_xvc_server(const struct arguments &args, const cable_t &cable,
|
||||
const jtag_pins_conf_t *pins_config)
|
||||
{
|
||||
|
|
@ -988,7 +988,7 @@ int parse_opt(int argc, char **argv, struct arguments *args,
|
|||
("h,help", "Give this help list")
|
||||
("verify", "Verify write operation (SPI Flash only)",
|
||||
cxxopts::value<bool>(args->verify))
|
||||
#ifdef ENABLE_XVC
|
||||
#ifdef ENABLE_XVC_SERVER
|
||||
("xvc", "Xilinx Virtual Cable Functions",
|
||||
cxxopts::value<bool>(args->xvc))
|
||||
#endif
|
||||
|
|
|
|||
Loading…
Reference in New Issue