Commit 828e80ed3e671978036e456bb598e8a688c81d5f

Kano 2013-12-31T15:29:09

Add minion driver into cgminer

diff --git a/Makefile.am b/Makefile.am
index 2311ead..de7bf39 100644
--- a/Makefile.am
+++ b/Makefile.am
@@ -92,6 +92,10 @@ if HAS_BAB
 cgminer_SOURCES += driver-bab.c
 endif
 
+if HAS_MINION
+cgminer_SOURCES += driver-minion.c
+endif
+
 if HAS_MODMINER
 cgminer_SOURCES += driver-modminer.c
 bitstreamsdir = $(bindir)/bitstreams
diff --git a/README b/README
index 080bbaa..40d6374 100644
--- a/README
+++ b/README
@@ -111,6 +111,7 @@ CGMiner specific configuration options:
   --enable-icarus         Compile support for Icarus (default disabled)
   --enable-knc            Compile support for KnC miners (default disabled)
   --enable-bab            Compile support for BlackArrow Bitfury (default disabled)
+  --enable-minion         Compile support for BlackArrow Minion ASIC (default disabled)
   --enable-klondike       Compile support for Klondike (default disabled)
   --enable-modminer       Compile support for ModMiner FPGAs(default disabled)
   --without-curses        Compile support for curses TUI (default enabled)
diff --git a/api.c b/api.c
index 528f10d..c0055bd 100644
--- a/api.c
+++ b/api.c
@@ -25,7 +25,7 @@
 #include "miner.h"
 #include "util.h"
 
-#if defined(USE_BFLSC) || defined(USE_AVALON) || defined(USE_HASHFAST) || defined(USE_BITFURY) || defined(USE_KLONDIKE) || defined(USE_KNC) || defined(USE_BAB) || defined(USE_DRILLBIT)
+#if defined(USE_BFLSC) || defined(USE_AVALON) || defined(USE_HASHFAST) || defined(USE_BITFURY) || defined(USE_KLONDIKE) || defined(USE_KNC) || defined(USE_BAB) || defined(USE_DRILLBIT) || defined(USE_MINION)
 #define HAVE_AN_ASIC 1
 #endif
 
@@ -183,6 +183,9 @@ static const char *DEVICECODE = ""
 #ifdef USE_BAB
 			"BaB "
 #endif
+#ifdef USE_MINION
+			"MBA "
+#endif
 #ifdef USE_MODMINER
 			"MMQ "
 #endif
diff --git a/cgminer.c b/cgminer.c
index 553ce1e..2aed581 100644
--- a/cgminer.c
+++ b/cgminer.c
@@ -1532,6 +1532,9 @@ static char *opt_verusage_and_exit(const char *extra)
 #ifdef USE_BAB
 		"BaB "
 #endif
+#ifdef USE_MINION
+		"minion "
+#endif
 #ifdef USE_MODMINER
 		"modminer "
 #endif
diff --git a/configure.ac b/configure.ac
index ae627e4..862d940 100644
--- a/configure.ac
+++ b/configure.ac
@@ -236,6 +236,17 @@ if test "x$knc" = xyes; then
 fi
 AM_CONDITIONAL([HAS_KNC], [test x$knc = xyes])
 
+minion="no"
+
+AC_ARG_ENABLE([minion],
+	[AC_HELP_STRING([--enable-minion],[Compile support for BlackArrow Bitfury (default disabled)])],
+	[minion=$enableval]
+	)
+if test "x$minion" = xyes; then
+	AC_DEFINE([USE_MINION], [1], [Defined to 1 if Minion BlackArrow ASIC support is wanted])
+fi
+AM_CONDITIONAL([HAS_MINION], [test x$minion = xyes])
+
 modminer="no"
 
 AC_ARG_ENABLE([modminer],
@@ -450,6 +461,12 @@ else
 	echo "  Avalon.ASICs.........: Disabled"
 fi
 
+if test "x$minion" = xyes; then
+	echo "  BlackArrowMinion.ASIC: Enabled"
+else
+	echo "  BlackArrowMinion.ASIC: Disabled"
+fi
+
 if test "x$bab" = xyes; then
 	echo "  BlackArrow.ASICs.....: Enabled"
 else
@@ -510,7 +527,7 @@ else
 	echo "  ModMiner.FPGAs.......: Disabled"
 fi
 
-if test "x$avalon$bab$bflsc$bitforce$bitfury$hashfast$icarus$klondike$knc$modminer$drillbit" = xnonononononononononono; then
+if test "x$avalon$bab$bflsc$bitforce$bitfury$hashfast$icarus$klondike$knc$modminer$drillbit$minion" = xnononononononononononono; then
 	AC_MSG_ERROR([No mining configured in])
 fi
 
diff --git a/miner.h b/miner.h
index 6a1c1fb..cab07c6 100644
--- a/miner.h
+++ b/miner.h
@@ -239,6 +239,7 @@ static inline int fsync (int fd)
 	DRIVER_ADD_COMMAND(knc) \
 	DRIVER_ADD_COMMAND(drillbit) \
 	DRIVER_ADD_COMMAND(bab) \
+	DRIVER_ADD_COMMAND(minion) \
 	DRIVER_ADD_COMMAND(avalon)
 
 #define DRIVER_PARSE_COMMANDS(DRIVER_ADD_COMMAND) \