Browse Source

Merge branch 'master' into hashfast

nfactor-troky
Con Kolivas 11 years ago
parent
commit
2d67bb06dc
  1. 75
      ASIC-README
  2. 66
      NEWS
  3. 30
      README
  4. 11
      cgminer.c
  5. 2
      configure.ac
  6. 31
      driver-avalon.c
  7. 6
      driver-avalon.h
  8. 11
      driver-klondike.c
  9. 1
      miner.h

75
ASIC-README

@ -102,11 +102,13 @@ ASIC SPECIFIC COMMANDS
--avalon-options <arg> Set avalon options baud:miners:asic:timeout:freq --avalon-options <arg> Set avalon options baud:miners:asic:timeout:freq
--avalon-temp <arg> Set avalon target temperature (default: 50) --avalon-temp <arg> Set avalon target temperature (default: 50)
--bflsc-overheat <arg> Set overheat temperature where BFLSC devices throttle, 0 to disable (default: 90) --bflsc-overheat <arg> Set overheat temperature where BFLSC devices throttle, 0 to disable (default: 90)
--bitburner-voltage <arg> Set BitBurner core voltage, in millivolts --bitburner-fury-options <arg> Override avalon-options for BitBurner Fury boards baud:miners:asic:timeout:freq
--bitburner-fury-voltage <arg> Set BitBurner Fury core voltage, in millivolts
--bitburner-voltage <arg> Set BitBurner (Avalon) core voltage, in millivolts
--klondike-options <arg> Set klondike options clock:temp1:temp2:fan --klondike-options <arg> Set klondike options clock:temp1:temp2:fan
AVALON DEVICES AVALON AND BITBURNER DEVICES
Currently all known Avalon devices come with their own operating system and Currently all known Avalon devices come with their own operating system and
a preinstalled version of cgminer as part of the flash firmware, based on the a preinstalled version of cgminer as part of the flash firmware, based on the
@ -118,6 +120,9 @@ command, and adjust its fan control-temperature relationship with avalon-temp.
By default the avalon will also cut off when its temperature reaches 60 By default the avalon will also cut off when its temperature reaches 60
degrees. degrees.
All current BitBurner devices (BitBurner X, BitBurner XX and BitBurner Fury)
emulate Avalon devices, whether or not they use Avalon chips.
Avalon commands: Avalon commands:
--avalon-auto Adjust avalon overclock frequency dynamically for best hashrate --avalon-auto Adjust avalon overclock frequency dynamically for best hashrate
@ -126,7 +131,9 @@ Avalon commands:
--avalon-freq <arg> Set frequency range for avalon-auto, single value or range --avalon-freq <arg> Set frequency range for avalon-auto, single value or range
--avalon-options <arg> Set avalon options baud:miners:asic:timeout:freq --avalon-options <arg> Set avalon options baud:miners:asic:timeout:freq
--avalon-temp <arg> Set avalon target temperature (default: 50) --avalon-temp <arg> Set avalon target temperature (default: 50)
--bitburner-voltage <arg> Set BitBurner core voltage, in millivolts --bitburner-fury-options <arg> Override avalon-options for BitBurner Fury boards baud:miners:asic:timeout:freq
--bitburner-fury-voltage <arg> Set BitBurner Fury core voltage, in millivolts
--bitburner-voltage <arg> Set BitBurner (Avalon) core voltage, in millivolts
Avalon auto will enable dynamic overclocking gradually increasing and Avalon auto will enable dynamic overclocking gradually increasing and
@ -177,8 +184,15 @@ Miners:
Most Avalons are 3 module devices, which come to 24 miners. 4 module devices Most Avalons are 3 module devices, which come to 24 miners. 4 module devices
would use 32 here. would use 32 here.
For BitBurner X and BitBurner XX devices you should use twice the number of
boards in the stack. e.g. for a two-board stack you would use 4. For
BitBurner Fury devices you should use the total number of BitFury chips in the
stack (i.e. 16 times the number of boards). e.g. for a two-board stack you
would use 32.
Asic count: Asic count:
Virtually all have 10, so don't change this. Virtually all have 10, so don't change this. BitBurner devices use 10 here
even if the boards have some other number of ASICs.
Timeout: Timeout:
This is how long the device will work on a work item before accepting new work This is how long the device will work on a work item before accepting new work
@ -198,16 +212,61 @@ Sample settings for valid different frequencies (last 2 values):
50:256 50:256
Frequency: Frequency:
This is the clock speed of the devices. Only specific values work, 256, 270, This is the clock speed of the devices. For Avalon devices, only specific
282 (default), 300, 325, 350 and 375. values work, 256, 270, 282 (default), 300, 325, 350 and 375. For BitBurner
devices, other values can be used.
Note that setting a value with an asterisk next to it will be using your Note that setting a value with an asterisk next to it will be using your
avalon outside its spec and you do so at your own risk. avalon outside its spec and you do so at your own risk.
The default frequency for BitBurner X and BitBurner XX boards is 282. The
default frequency for BitBurner Fury boards is 256. Overclocking is
possible - please consult the product documentation and/or manufacturer for
information on safe values. Values outside this range are used at your own
risk. Underclocking is also possible, at least with the X and XX boards.
eg:
--bitburner-fury-options <arg> Override avalon-options for BitBurner Fury boards baud:miners:asic:timeout:freq
This option takes the same format as --avalon-options. When specified, it
will be used for BitBurner Fury boards in preference to the values specified
in --avalon-options. (If not specified, BitBurner Fury boards will be
controlled by the values used in --avalon options.) See --avalon-options for
a detailed description of the fields.
This option is particularly useful when using a mixture of different BitBurner
devices as BitBurner Fury devices generally require significantly different
clock frequencies from Avalon-based devices. This option is only available
for boards with recent firmware that are recognized by cgminer as BBF.
eg: eg:
--bitburner-voltage <arg> Set BitBurner core voltage, in millivolts --bitburner-fury-voltage <arg> Set BitBurner Fury core voltage, in millivolts
Sets the core voltage for the BitBurner Fury boards. The default value is
900. Overvolting is possible - please consult the product documentation
and/or manufaturer about the safe range of values. Values outside this range
are used at your own risk.
This option is only available for boards with recent firmware that are
recognized by cgminer as BBF. For boards recognized as BTB, see
--bitburner-voltage
eg:
--bitburner-voltage <arg> Set BitBurner (Avalon) core voltage, in millivolts
Sets the core voltage for the Avalon-based BitBurner X and BitBurner XX
boards. The default value is 1200. Overvolting and undervolting is
possible - please consult the product documentation and/or the manufacturer
for information about the safe range. Values outside this range are used at
your own risk.
Older BitBurner Fury firmware emulates a BitBurner XX board and is identified
by cgminer as BTB. On these devices, --bitburner-voltage is used to control
the voltage of the BitBurner Fury board. The actual core voltage will be
300mV less than the requested voltage, so to run a BitBurner Fury board at
950mV use --bitburner-voltage 1250. The default value of 1200 therefore
corresponds to the default core voltage of 900mV.
Self evident.
If you use the full curses based interface with Avalons you will get this If you use the full curses based interface with Avalons you will get this
information: information:

66
NEWS

@ -1,3 +1,69 @@
Version 3.6.5 - 26th October 2013
- klondike - fix uninitialised dev bug
- Adjust the binary ntime data in submit_noffset_nonce even when there is no hex
ntime string for eg. gbt.
- Put an entry into the work struct telling drivers how much they can roll the
ntime themselves.
- Only set libusb cancellable status if the transfer succeeds.
- Remove the applog on miner threads dying to prevent deadlocks on exit.
- Do one extra guaranteed libusb event handling before testing if there are any
pending async usb transfers.
- Use a linked list for all usb transfers instead of just cancellable ones.
- Provide a mechanism for informing drivers of updated work templates for
stratum and gbt mining.
- Add cancellable transfers correctly to the ct_list
- Check for presence of thr in icarus get nonce for startup nonce testing to
work.
- Use cancellable usb transfers in the icarus driver to avoid having to loop and
poll when waiting for a response and to speed up work restart response time.
- Add a usb_read_ii_timeout_cancellable wrapper
- Add usb transfer cancellation on shutdown and documentation regarding where
cancellable transfers are suitable.
- Use cancellable transfers on bitfury device.
- Cancel cancellable usb transfers on work restart messages.
- Don't bother having a separate cancellable transfer struct for usb transfers,
simply include the list in the usb_transfer struct.
- Add wrappers for usb_read_cancellable and usb_read_timeout_cancellable
- Specifically set the cancellable state for it to not be uninitialised in the
usb transfer struct.
- Alter the usb cancellable list only under cgusb_fd_lock write lock.
- Pass the cancellable option to _usb_read options to decide on whether to add
usb transfers to the list of cancellable transfers.
- Create a linked list of potentially cancellable usb transfers.
- Don't attempt to disable curses or print a summary during an app restart to
prevent deadlocks.
- Keep the libusb event handle polling thread active until there are no async
usb transfers in progress.
- Keep a global counter of how many async usb transfers are in place.
- Perform libusb_submit_transfer under the write variant of cgusb_fd_lock
- klondike - error condition handling
- Avoid entering static libusb directory if --with-system-libusb is enabled.
- Minor opencl build corrections.
- Enable dynamic linking against system libusb --with-system-libusb
- Modify Makefile to only include opencl related code when configured in.
- Convert opencl to need to be explicitly enabled during build with
--enable-opencl
- Implement a cglock_destroy function.
- Implement a rwlock_destroy function.
- Implement a mutex_destroy function.
- Add usb command name to critical libusb error reporting.
- Use windows' own higher resolution time and handlers allowing us to have
higher precision absolute timeouts.
- Fix lldiv error in windows cgminer_t calculation.
- miner.php correct sort gen field names largest to smallest
- api ... the code related to device elapsed
- api add device elapsed since hotplug devices Elapsed is less than cgminer
Elapsed
- Drop usb buffering message to debug logging level.
- Do the ntime binary modification to the work struct when submitting an ntime
offset nonce within submit_noffset_nonce
- Code cleanup and improved documentation
- Improvements to support for BitBurner boards
- Convert libusb transfer errors to regular libusb error messages to allow for
accurate message reporting.
Version 3.6.4 - 18th October 2013 Version 3.6.4 - 18th October 2013
- Fixing the memory leak for remaining semaphores means we can go back to using - Fixing the memory leak for remaining semaphores means we can go back to using

30
README

@ -106,17 +106,21 @@ If building from git:
CGMiner specific configuration options: CGMiner specific configuration options:
--disable-opencl Override detection and disable building with opencl --enable-opencl Enable support for GPU mining with opencl
--disable-adl Override detection and disable building with adl --disable-adl Override detection and disable building with adl
--enable-bflsc Compile support for BFL ASICs (default disabled) --enable-scrypt Compile support for scrypt litecoin mining (default
--enable-bitforce Compile support for BitForce FPGAs(default disabled) disabled)
--enable-icarus Compile support for Icarus bitstream FPGAs(default disabled) --enable-bflsc Compile support for BFL ASICs (default disabled)
--enable-modminer Compile support for ModMiner FPGAs(default disabled) --enable-bitforce Compile support for BitForce FPGAs (default
--enable-ztex Compile support for Ztex Board(default disabled) disabled)
--enable-avalon Compile support for Avalon (default disabled) --enable-bitfury Compile support for BitFury ASICs (default disabled)
--enable-klondike Compile support for Klondike (default disabled) --enable-icarus Compile support for Icarus (default disabled)
--enable-scrypt Compile support for scrypt litecoin mining (default disabled) --enable-avalon Compile support for Avalon (default disabled)
--without-curses Compile support for curses TUI (default enabled) --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)
--with-system-libusb Compile against dynamic system libusb (default use
included static libusb)
Basic *nix build instructions: Basic *nix build instructions:
To actually build: To actually build:
@ -220,7 +224,9 @@ ASIC only options:
--avalon-options <arg> Set avalon options baud:miners:asic:timeout:freq --avalon-options <arg> Set avalon options baud:miners:asic:timeout:freq
--avalon-temp <arg> Set avalon target temperature (default: 50) --avalon-temp <arg> Set avalon target temperature (default: 50)
--bflsc-overheat <arg> Set overheat temperature where BFLSC devices throttle, 0 to disable (default: 90) --bflsc-overheat <arg> Set overheat temperature where BFLSC devices throttle, 0 to disable (default: 90)
--bitburner-voltage <arg> Set BitBurner core voltage, in millivolts --bitburner-fury-options <arg> Override avalon-options for BitBurner Fury boards baud:miners:asic:timeout:freq
--bitburner-fury-voltage <arg> Set BitBurner Fury core voltage, in millivolts
--bitburner-voltage <arg> Set BitBurner (Avalon) core voltage, in millivolts
See ASIC-README for more information regarding these. See ASIC-README for more information regarding these.

11
cgminer.c

@ -171,6 +171,7 @@ char *opt_icarus_timing = NULL;
bool opt_worktime; bool opt_worktime;
#ifdef USE_AVALON #ifdef USE_AVALON
char *opt_avalon_options = NULL; char *opt_avalon_options = NULL;
char *opt_bitburner_fury_options = NULL;
#endif #endif
#ifdef USE_KLONDIKE #ifdef USE_KLONDIKE
char *opt_klondike_options = NULL; char *opt_klondike_options = NULL;
@ -1040,6 +1041,13 @@ static char *set_avalon_options(const char *arg)
return NULL; return NULL;
} }
static char *set_bitburner_fury_options(const char *arg)
{
opt_set_charp(arg, &opt_bitburner_fury_options);
return NULL;
}
#endif #endif
#ifdef USE_KLONDIKE #ifdef USE_KLONDIKE
@ -1259,6 +1267,9 @@ static struct opt_table opt_config_table[] = {
OPT_WITH_ARG("--bitburner-fury-voltage", OPT_WITH_ARG("--bitburner-fury-voltage",
opt_set_intval, NULL, &opt_bitburner_fury_core_voltage, opt_set_intval, NULL, &opt_bitburner_fury_core_voltage,
"Set BitBurner Fury core voltage, in millivolts"), "Set BitBurner Fury core voltage, in millivolts"),
OPT_WITH_ARG("--bitburner-fury-options",
set_bitburner_fury_options, NULL, NULL,
"Override avalon-options for BitBurner Fury boards baud:miners:asic:timeout:freq"),
#endif #endif
#ifdef USE_KLONDIKE #ifdef USE_KLONDIKE
OPT_WITH_ARG("--klondike-options", OPT_WITH_ARG("--klondike-options",

2
configure.ac

@ -2,7 +2,7 @@
##--##--##--##--##--##--##--##--##--##--##--##--##--##--##--##--## ##--##--##--##--##--##--##--##--##--##--##--##--##--##--##--##--##
m4_define([v_maj], [3]) m4_define([v_maj], [3])
m4_define([v_min], [6]) m4_define([v_min], [6])
m4_define([v_mic], [4]) m4_define([v_mic], [5])
##--##--##--##--##--##--##--##--##--##--##--##--##--##--##--##--## ##--##--##--##--##--##--##--##--##--##--##--##--##--##--##--##--##
m4_define([v_ver], [v_maj.v_min.v_mic]) m4_define([v_ver], [v_maj.v_min.v_mic])
m4_define([lt_rev], m4_eval(v_maj + v_min)) m4_define([lt_rev], m4_eval(v_maj + v_min))

31
driver-avalon.c

@ -53,6 +53,7 @@ int opt_bitburner_fury_core_voltage = BITBURNER_FURY_DEFAULT_CORE_VOLTAGE;
bool opt_avalon_auto; bool opt_avalon_auto;
static int option_offset = -1; static int option_offset = -1;
static int bbf_option_offset = -1;
static int avalon_init_task(struct avalon_task *at, static int avalon_init_task(struct avalon_task *at,
uint8_t reset, uint8_t ff, uint8_t fan, uint8_t reset, uint8_t ff, uint8_t fan,
@ -400,7 +401,7 @@ static int avalon_calc_timeout(int frequency)
} }
static bool get_options(int this_option_offset, int *baud, int *miner_count, static bool get_options(int this_option_offset, int *baud, int *miner_count,
int *asic_count, int *timeout, int *frequency) int *asic_count, int *timeout, int *frequency, char *options)
{ {
char buf[BUFSIZ+1]; char buf[BUFSIZ+1];
char *ptr, *comma, *colon, *colon2, *colon3, *colon4; char *ptr, *comma, *colon, *colon2, *colon3, *colon4;
@ -408,10 +409,10 @@ static bool get_options(int this_option_offset, int *baud, int *miner_count,
size_t max; size_t max;
int i, tmp; int i, tmp;
if (opt_avalon_options == NULL) if (options == NULL)
buf[0] = '\0'; buf[0] = '\0';
else { else {
ptr = opt_avalon_options; ptr = options;
for (i = 0; i < this_option_offset; i++) { for (i = 0; i < this_option_offset; i++) {
comma = strchr(ptr, ','); comma = strchr(ptr, ',');
if (comma == NULL) if (comma == NULL)
@ -754,7 +755,7 @@ static void bitburner_get_version(struct cgpu_info *avalon)
static bool avalon_detect_one(libusb_device *dev, struct usb_find_devices *found) static bool avalon_detect_one(libusb_device *dev, struct usb_find_devices *found)
{ {
int baud, miner_count, asic_count, timeout, frequency; int baud, miner_count, asic_count, timeout, frequency;
int this_option_offset = ++option_offset; int this_option_offset;
struct avalon_info *info; struct avalon_info *info;
struct cgpu_info *avalon; struct cgpu_info *avalon;
bool configured; bool configured;
@ -768,12 +769,14 @@ static bool avalon_detect_one(libusb_device *dev, struct usb_find_devices *found
timeout = AVALON_DEFAULT_TIMEOUT; timeout = AVALON_DEFAULT_TIMEOUT;
frequency = AVALON_DEFAULT_FREQUENCY; frequency = AVALON_DEFAULT_FREQUENCY;
configured = get_options(this_option_offset, &baud, &miner_count,
&asic_count, &timeout, &frequency);
if (!usb_init(avalon, dev, found)) if (!usb_init(avalon, dev, found))
goto shin; goto shin;
this_option_offset = usb_ident(avalon) == IDENT_BBF ? ++bbf_option_offset : ++option_offset;
configured = get_options(this_option_offset, &baud, &miner_count,
&asic_count, &timeout, &frequency,
(usb_ident(avalon) == IDENT_BBF && opt_bitburner_fury_options != NULL) ? opt_bitburner_fury_options : opt_avalon_options);
/* Even though this is an FTDI type chip, we want to do the parsing /* Even though this is an FTDI type chip, we want to do the parsing
* all ourselves so set it to std usb type */ * all ourselves so set it to std usb type */
avalon->usbdev->usb_type = USB_TYPE_STD; avalon->usbdev->usb_type = USB_TYPE_STD;
@ -796,10 +799,18 @@ static bool avalon_detect_one(libusb_device *dev, struct usb_find_devices *found
info->frequency = frequency; info->frequency = frequency;
} else { } else {
info->baud = AVALON_IO_SPEED; info->baud = AVALON_IO_SPEED;
info->miner_count = AVALON_DEFAULT_MINER_NUM;
info->asic_count = AVALON_DEFAULT_ASIC_NUM; info->asic_count = AVALON_DEFAULT_ASIC_NUM;
info->timeout = AVALON_DEFAULT_TIMEOUT; switch (usb_ident(avalon)) {
info->frequency = AVALON_DEFAULT_FREQUENCY; case IDENT_BBF:
info->miner_count = BITBURNER_FURY_DEFAULT_MINER_NUM;
info->timeout = BITBURNER_FURY_DEFAULT_TIMEOUT;
info->frequency = BITBURNER_FURY_DEFAULT_FREQUENCY;
break;
default:
info->miner_count = AVALON_DEFAULT_MINER_NUM;
info->timeout = AVALON_DEFAULT_TIMEOUT;
info->frequency = AVALON_DEFAULT_FREQUENCY;
}
} }
info->fan_pwm = AVALON_DEFAULT_FAN_MIN_PWM; info->fan_pwm = AVALON_DEFAULT_FAN_MIN_PWM;

6
driver-avalon.h

@ -55,6 +55,12 @@
#define AVALON_MAX_MINER_NUM 0x100 #define AVALON_MAX_MINER_NUM 0x100
#define AVALON_DEFAULT_ASIC_NUM 0xA #define AVALON_DEFAULT_ASIC_NUM 0xA
/* Default number of miners for Bitburner Fury is for a stack of 8 boards,
but it will work acceptably for smaller stacks, too */
#define BITBURNER_FURY_DEFAULT_MINER_NUM 128
#define BITBURNER_FURY_DEFAULT_FREQUENCY 256
#define BITBURNER_FURY_DEFAULT_TIMEOUT 50
#define AVALON_AUTO_CYCLE 1024 #define AVALON_AUTO_CYCLE 1024
#define AVALON_FTDI_READSIZE 510 #define AVALON_FTDI_READSIZE 510

11
driver-klondike.c

@ -968,10 +968,9 @@ static void *klondike_get_replies(void *userdata)
// We can't check this until it's initialised // We can't check this until it's initialised
if (klninfo->initialised) { if (klninfo->initialised) {
wr_lock(&(klninfo->stat_lock)); rd_lock(&(klninfo->stat_lock));
slaves = klninfo->status[0].kline.ws.slavecount; slaves = klninfo->status[0].kline.ws.slavecount;
klninfo->jobque[dev].late_update_sequential = 0; rd_unlock(&(klninfo->stat_lock));
wr_unlock(&(klninfo->stat_lock));
if (kitem->kline.hd.dev > slaves) { if (kitem->kline.hd.dev > slaves) {
applog(LOG_ERR, "%s%i: reply [%c] has invalid dev=%d (max=%d) using 0", applog(LOG_ERR, "%s%i: reply [%c] has invalid dev=%d (max=%d) using 0",
@ -979,7 +978,13 @@ static void *klondike_get_replies(void *userdata)
(char)(kitem->kline.hd.cmd), (char)(kitem->kline.hd.cmd),
(int)(kitem->kline.hd.dev), (int)(kitem->kline.hd.dev),
slaves); slaves);
/* TODO: this is rather problematic if there are slaves
* however without slaves - it should always be zero */
kitem->kline.hd.dev = 0; kitem->kline.hd.dev = 0;
} else {
wr_lock(&(klninfo->stat_lock));
klninfo->jobque[kitem->kline.hd.dev].late_update_sequential = 0;
wr_unlock(&(klninfo->stat_lock));
} }
} }

1
miner.h

@ -1023,6 +1023,7 @@ extern char *opt_icarus_timing;
extern bool opt_worktime; extern bool opt_worktime;
#ifdef USE_AVALON #ifdef USE_AVALON
extern char *opt_avalon_options; extern char *opt_avalon_options;
extern char *opt_bitburner_fury_options;
#endif #endif
#ifdef USE_KLONDIKE #ifdef USE_KLONDIKE
extern char *opt_klondike_options; extern char *opt_klondike_options;

Loading…
Cancel
Save