Browse Source

Build titan driver independently from knc (Jupiter) driver

Luke Dashjr 11 years ago
parent
commit
2af2598852
4 changed files with 37 additions and 9 deletions
  1. 5 5
      Makefile.am
  2. 1 0
      README
  3. 1 1
      README.ASIC
  4. 30 3
      configure.ac

+ 5 - 5
Makefile.am

@@ -275,13 +275,8 @@ bfgminer_SOURCES += driver-avalonmm.c
 endif
 
 if USE_KNC
-if HAS_SCRYPT
-bfgminer_SOURCES += driver-titan.c titan-asic.c knc-asic/knc-asic.c knc-asic/knc-spimux.c knc-asic/knc-transport-spimux.c titan-asic.h knc-asic/include/knc-asic.h knc-asic/include/knc-transport.h
-bfgminer_CPPFLAGS += -I. -I./knc-asic/include -I./knc-asic
-else
 bfgminer_SOURCES += driver-knc.c
 endif
-endif
 
 if HAS_KLONDIKE
 bfgminer_SOURCES += driver-klondike.c driver-klondike.h driver-hashbusteravalon.c
@@ -291,6 +286,11 @@ if HAS_MODMINER
 bfgminer_SOURCES += driver-modminer.c
 endif
 
+if USE_TITAN
+bfgminer_SOURCES += driver-titan.c titan-asic.c knc-asic/knc-asic.c knc-asic/knc-spimux.c knc-asic/knc-transport-spimux.c titan-asic.h knc-asic/include/knc-asic.h knc-asic/include/knc-transport.h
+bfgminer_CPPFLAGS += -I. -I./knc-asic/include -I./knc-asic
+endif
+
 if HAS_X6500
 bfgminer_SOURCES += driver-x6500.c jtag.c jtag.h
 endif

+ 1 - 0
README

@@ -168,6 +168,7 @@ BFGMiner driver configuration options:
 	--enable-opencl         Compile support for OpenCL (default disabled)
 	--disable-adl           Build without ADL monitoring (default enabled)
 	--disable-rockminer     Compile support for RockMiner (default enabled)
+	--enable-titan          Compile support for KnC Titan (default disabled)
 	--disable-twinfury      Compile support for Twinfury USB miner (default
 	                        enabled)
 	--disable-x6500         Compile support for X6500 (default if libusb)

+ 1 - 1
README.ASIC

@@ -217,7 +217,7 @@ Build instructions:
 git clone git@github.com:KnCMiner/bfgminer.git
 cd bfgminer
 ./autogen.sh
-./configure --enable-scrypt --enable-knc --disable-other-drivers --without-libusb --disable-gridseed CFLAGS="-g -Iuthash/src -DCONTROLLER_BOARD_RPI"
+./configure --enable-scrypt --enable-titan --disable-other-drivers --without-libusb --disable-gridseed CFLAGS="-g -Iuthash/src -DCONTROLLER_BOARD_RPI"
 make
 sudo /etc/init.d/bfgminer.sh restart
 screen -r

+ 30 - 3
configure.ac

@@ -609,9 +609,7 @@ if test "x$knc" = xyes; then
 		#endif
 	])
 	AC_DEFINE([USE_KNC], [1], [Defined to 1 if KnC support is wanted])
-	if test "x$scrypt" != xyes; then
-		need_lowl_spi=yes
-	fi
+	need_lowl_spi=yes
 fi
 AM_CONDITIONAL([USE_KNC], [test x$knc = xyes])
 
@@ -755,6 +753,35 @@ fi
 AM_CONDITIONAL([HAS_KLONDIKE], [test x$klondike = xyes])
 
 
+driverlist="$driverlist titan"
+AC_ARG_ENABLE([titan],
+	[AC_HELP_STRING([--enable-titan],[Compile support for KnC Titan (default disabled)])],
+	[titan=$enableval],
+	[titan=$ddno]
+	)
+if test "x$titan" = xyes; then
+	if test "x$scrypt" = "xno"; then
+		AC_MSG_ERROR([You explicitly enabled KnC Titan, but did not enable scrypt])
+	fi
+	AC_CHECK_HEADERS([linux/i2c-dev-user.h])
+	AC_CHECK_DECL([i2c_smbus_read_word_data],[true],[
+		AC_MSG_ERROR([linux/i2c-dev.h header from i2c-tools/libi2c-dev (NOT linux headers) is required for titan driver])
+	],[
+		#include <stddef.h>
+		#ifdef HAVE_LINUX_I2C_DEV_USER_H
+		#include <linux/i2c-dev-user.h>
+		#else
+		#ifdef NEED_LINUX_I2C_H
+		#include <linux/i2c.h>
+		#endif
+		#include <linux/i2c-dev.h>
+		#endif
+	])
+	AC_DEFINE([USE_TITAN], [1], [Defined to 1 if KnC Titan support is wanted])
+fi
+AM_CONDITIONAL([USE_TITAN], [test x$titan = xyes])
+
+
 driverlist="$driverlist x6500"
 AC_ARG_ENABLE([x6500],
 	[AC_HELP_STRING([--disable-x6500],[Compile support for X6500 (default if libusb)])],