Skip to content

Commit

Permalink
Merge pull request #677 from kanoi/master
Browse files Browse the repository at this point in the history
AntS3
  • Loading branch information
kanoi committed Jun 7, 2015
2 parents 62573e7 + 713941c commit 5013002
Show file tree
Hide file tree
Showing 11 changed files with 473 additions and 143 deletions.
15 changes: 10 additions & 5 deletions ASIC-README
Original file line number Diff line number Diff line change
Expand Up @@ -271,12 +271,17 @@ ASIC SPECIFIC COMMANDS
--bitburner-fury-voltage <arg> Set BitBurner Fury core voltage, in millivolts
--bitburner-voltage <arg> Set BitBurner (Avalon) core voltage, in millivolts
--bitmain-auto Adjust bitmain overclock frequency dynamically for best hashrate
--bitmain-cutoff Set bitmain overheat cut off temperature
--bitmain-fan Set fanspeed percentage for bitmain, single value or range (default: 20-100)
--bitmain-freq Set frequency range for bitmain-auto, single value or range
--bitmain-cutoff <arg> Set bitmain overheat cut off temperature
--bitmain-fan <arg> Set fanspeed percentage for bitmain, single value or range (default: 20-100)
--bitmain-freq <arg> Set bitmain freq options timeout:freq:regdata
--bitmain-hwerror Set bitmain device detect hardware error
--bitmain-options Set bitmain options baud:miners:asic:timeout:freq
--bitmain-temp Set bitmain target temperature
--bitmain-options <arg> Set bitmain options baud:miners:asic:timeout:freq:regdata
--bitmain-temp <arg> Set bitmain target temperature
--bitmain-workdelay <arg> Set bitmain work delay (ms) 0-100
--bitmain-voltage <arg> Set bitmain voltage - S2/S3 only
--bitmain-dev <arg> Set bitmain device - S2 only
--bitmainbeeper Set bitmain beeper ringing
--bitmaintempoverctrl Set bitmain stop runing when temprerature is over 80 degree Celsius
--bxf-bits <arg> Set max BXF/HXF bits for overclocking (default: 54)
--bxf-temp-target <arg> Set target temperature for BXF/HXF devices (default: 82)
--bxm-bits <arg> Set BXM bits for overclocking (default: 54)
Expand Down
4 changes: 4 additions & 0 deletions Makefile.am
Original file line number Diff line number Diff line change
Expand Up @@ -154,6 +154,10 @@ if HAS_ANT_S2
cgminer_SOURCES += driver-bitmain.c driver-bitmain.h
endif

if HAS_ANT_S3
cgminer_SOURCES += driver-bitmain.c driver-bitmain.h
endif

if HAS_MODMINER
cgminer_SOURCES += driver-modminer.c
bitstreamsdir = $(bindir)/bitstreams
Expand Down
15 changes: 10 additions & 5 deletions README
Original file line number Diff line number Diff line change
Expand Up @@ -227,12 +227,17 @@ Options for both config file and command line:
--bitburner-fury-options <arg> Override avalon-options for BitBurner Fury boards baud:miners:asic:timeout:freq
--bitburner-voltage <arg> Set BitBurner (Avalon) core voltage, in millivolts
--bitmain-auto Adjust bitmain overclock frequency dynamically for best hashrate
--bitmain-cutoff Set bitmain overheat cut off temperature
--bitmain-fan Set fanspeed percentage for bitmain, single value or range (default: 20-100)
--bitmain-freq Set frequency range for bitmain-auto, single value or range
--bitmain-cutoff <arg> Set bitmain overheat cut off temperature
--bitmain-fan <arg> Set fanspeed percentage for bitmain, single value or range (default: 20-100)
--bitmain-freq <arg> Set bitmain freq options timeout:freq:regdata
--bitmain-hwerror Set bitmain device detect hardware error
--bitmain-options Set bitmain options baud:miners:asic:timeout:freq
--bitmain-temp Set bitmain target temperature
--bitmain-options <arg> Set bitmain options baud:miners:asic:timeout:freq:regdata
--bitmain-temp <arg> Set bitmain target temperature
--bitmain-workdelay <arg> Set bitmain work delay (ms) 0-100
--bitmain-voltage <arg> Set bitmain voltage - S2/S3 only
--bitmain-dev <arg> Set bitmain device - S2 only
--bitmainbeeper Set bitmain beeper ringing
--bitmaintempoverctrl Set bitmain stop runing when temprerature is over 80 degree Celsius
--bxf-bits <arg> Set max BXF/HXF bits for overclocking (default: 54)
--bxf-temp-target <arg> Set target temperature for BXF/HXF devices (default: 82)
--bxm-bits <arg> Set BXM bits for overclocking (default: 54)
Expand Down
7 changes: 5 additions & 2 deletions api.c
Original file line number Diff line number Diff line change
Expand Up @@ -30,8 +30,8 @@
defined(USE_HASHFAST) || defined(USE_BITFURY) || defined(USE_BLOCKERUPTER) || defined(USE_KLONDIKE) || \
defined(USE_KNC) || defined(USE_BAB) || defined(USE_DRILLBIT) || \
defined(USE_MINION) || defined(USE_COINTERRA) || defined(USE_BITMINE_A1) || \
defined(USE_ANT_S1) || defined(USE_ANT_S2) || defined(USE_SP10) || defined(USE_SP30) || \
defined(USE_ICARUS) || defined(USE_HASHRATIO)
defined(USE_ANT_S1) || defined(USE_ANT_S2) || defined(USE_ANT_S3) || defined(USE_SP10) || \
defined(USE_SP30) || defined(USE_ICARUS) || defined(USE_HASHRATIO)
#define HAVE_AN_ASIC 1
#endif

Expand Down Expand Up @@ -166,6 +166,9 @@ static const char *DEVICECODE = ""
#ifdef USE_ANT_S2
"AS2 "
#endif
#ifdef USE_ANT_S3
"AS3 "
#endif
#ifdef USE_AVALON
"AVA "
#endif
Expand Down
29 changes: 27 additions & 2 deletions cgminer.c
Original file line number Diff line number Diff line change
Expand Up @@ -105,7 +105,7 @@ char *curly = ":D";
#include "driver-hashfast.h"
#endif

#if defined(USE_ANT_S1) || defined(USE_ANT_S2)
#if defined(USE_ANT_S1) || defined(USE_ANT_S2) || defined(USE_ANT_S3)
#include "driver-bitmain.h"
#endif

Expand Down Expand Up @@ -262,9 +262,15 @@ char *opt_bitmine_a1_options = NULL;
char *opt_bitmain_options;
static char *opt_set_bitmain_fan;
char *opt_bitmain_freq;
// Ignored
static bool opt_bitmain_nobeeper;
static bool opt_bitmain_notempoverctrl;
static bool opt_bitmain_homemode;
#endif
#ifdef USE_ANT_S2
#ifndef USE_ANT_S3
char *opt_bitmain_dev;
#endif
char *opt_bitmain_voltage = BITMAIN_VOLTAGE_DEF;
#endif
#ifdef USE_HASHFAST
Expand Down Expand Up @@ -1296,22 +1302,27 @@ static struct opt_table opt_config_table[] = {
OPT_WITH_ARG("--bitmain-options",
opt_set_charp, NULL, &opt_bitmain_options,
#ifdef USE_ANT_S1
"Set bitmain options baud:miners:asic:timeout:freq"
"Set bitmain options baud:miners:asic:timeout:freq:regdata"
#else
"Set bitmain options baud:miners:asic:ignored..."
#endif
),
OPT_WITH_ARG("--bitmain-temp",
set_int_0_to_100, opt_show_intval, &opt_bitmain_temp,
"Set bitmain target temperature"),
OPT_WITH_ARG("--bitmain-workdelay",
set_int_0_to_100, opt_show_intval, &opt_bitmain_workdelay,
"Set bitmain work delay (ms) 0-100"),
#endif
#ifdef USE_ANT_S2
OPT_WITH_ARG("--bitmain-voltage",
opt_set_charp, NULL, &opt_bitmain_voltage,
"Set bitmain voltage (default: "BITMAIN_VOLTAGE_DEF")"),
#ifndef USE_ANT_S3
OPT_WITH_ARG("--bitmain-dev",
opt_set_charp, NULL, &opt_bitmain_dev,
"Set bitmain device"),
#endif
OPT_WITHOUT_ARG("--bitmainbeeper",
opt_set_bool, &opt_bitmain_beeper,
"Set bitmain beeper ringing"),
Expand All @@ -1324,6 +1335,16 @@ static struct opt_table opt_config_table[] = {
OPT_WITHOUT_ARG("--bitmaintempoverctrl",
opt_set_bool, &opt_bitmain_tempoverctrl,
"Set bitmain stop runing when temprerature is over 80 degree Celsius"),
// Ignored
OPT_WITHOUT_ARG("--bitmain-nobeeper",
opt_set_bool, &opt_bitmain_nobeeper,
opt_hidden),
OPT_WITHOUT_ARG("--bitmain-notempoverctrl",
opt_set_bool, &opt_bitmain_notempoverctrl,
opt_hidden),
OPT_WITHOUT_ARG("--bitmain-homemode",
opt_set_bool, &opt_bitmain_homemode,
opt_hidden),
#endif
#ifdef USE_BITMINE_A1
OPT_WITH_ARG("--bitmine-a1-options",
Expand Down Expand Up @@ -1831,8 +1852,12 @@ static char *opt_verusage_and_exit(const char *extra)
"ant.S1 "
#endif
#ifdef USE_ANT_S2
#ifdef USE_ANT_S3
"ant.S3 "
#else
"ant.S2 "
#endif
#endif
#ifdef USE_AVALON
"avalon "
#endif
Expand Down
27 changes: 23 additions & 4 deletions configure.ac
Original file line number Diff line number Diff line change
Expand Up @@ -130,9 +130,10 @@ fi
# All drivers should prepend an x to the drivercount

standalone="no"
ants1="no"
drivercount=""

ants1="no"

AC_ARG_ENABLE([ants1],
[AC_HELP_STRING([--enable-ants1],[Compile support for Antminer S1 Bitmain STANDALONE(default disabled)])],
[ants1=$enableval]
Expand All @@ -144,7 +145,6 @@ if test "x$ants1" = xyes; then
fi
AM_CONDITIONAL([HAS_ANT_S1], [test x$ants1 = xyes])


ants2="no"

AC_ARG_ENABLE([ants2],
Expand All @@ -158,6 +158,19 @@ if test "x$ants2" = xyes; then
fi
AM_CONDITIONAL([HAS_ANT_S2], [test x$ants2 = xyes])

ants3="no"

AC_ARG_ENABLE([ants3],
[AC_HELP_STRING([--enable-ants3],[Compile support for Antminer S3 Bitmain STANDALONE(default disabled)])],
[ants3=$enableval]
)
if test "x$ants3" = xyes; then
AC_DEFINE([USE_ANT_S3], [1], [Defined to 1 if Antminer S3 Bitmain support is wanted])
drivercount=x$drivercount
standalone="yes"
fi
AM_CONDITIONAL([HAS_ANT_S3], [test x$ants3 = xyes])

avalon="no"

AC_ARG_ENABLE([avalon],
Expand Down Expand Up @@ -460,7 +473,7 @@ fi


#Add a new device to this list if it needs libusb, along with a no on the end.
if test x$avalon$avalon2$avalon4$bitforce$bitfury$blockerupter$modminer$bflsc$icarus$hashfast$hashratio$klondike$drillbit$cointerra$ants1 != xnonononononononononononononono; then
if test x$avalon$avalon2$avalon4$bitforce$bitfury$blockerupter$modminer$bflsc$icarus$hashfast$hashratio$klondike$drillbit$cointerra$ants1$ants3 != xnononononononononononononononono; then
want_usbutils=true
else
want_usbutils=false
Expand Down Expand Up @@ -666,6 +679,12 @@ else
echo " Antminer.S2.Bitmain..: Disabled"
fi

if test "x$ants3" = xyes; then
echo " Antminer.S3.Bitmain..: Enabled"
else
echo " Antminer.S3.Bitmain..: Disabled"
fi

if test "x$avalon" = xyes; then
echo " Avalon.ASICs.........: Enabled"
else
Expand Down Expand Up @@ -789,7 +808,7 @@ else
fi

#Add any new device to this, along with a no on the end of the test
if test "x$avalon$avalon2$avalon4$bab$bflsc$bitforce$bitfury$blockerupter$hashfast$hashratio$icarus$klondike$knc$modminer$drillbit$minion$cointerra$bitmine_A1$ants1$ants2$sp10$sp30" = xnononononononononononononononononononononono; then
if test "x$avalon$avalon2$avalon4$bab$bflsc$bitforce$bitfury$blockerupter$hashfast$hashratio$icarus$klondike$knc$modminer$drillbit$minion$cointerra$bitmine_A1$ants1$ants2$ants3$sp10$sp30" = xnonononononononononononononononononononononono; then
echo
AC_MSG_ERROR([No mining devices configured in])
echo
Expand Down
Loading

0 comments on commit 5013002

Please sign in to comment.