Add hidden hfa options to set hash clock, group ntime roll and pll bypass, fixing frame sent on reset to include extra data.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84
diff --git a/cgminer.c b/cgminer.c
index 65ca941..b0fadb1 100644
--- a/cgminer.c
+++ b/cgminer.c
@@ -74,6 +74,9 @@ char *curly = ":D";
#ifdef USE_HASHFAST
#include "driver-hashfast.h"
+int opt_hfa_ntime_roll;
+int opt_hfa_hash_clock;
+bool opt_hfa_pll_bypass;
#endif
#if defined(USE_BITFORCE) || defined(USE_ICARUS) || defined(USE_AVALON) || defined(USE_MODMINER)
@@ -1195,6 +1198,17 @@ static struct opt_table opt_config_table[] = {
set_bitburner_fury_options, NULL, NULL,
"Override avalon-options for BitBurner Fury boards baud:miners:asic:timeout:freq"),
#endif
+#ifdef USE_HASHFAST
+ OPT_WITH_ARG("--hfa-ntime-roll",
+ opt_set_intval, NULL, &opt_hfa_ntime_roll,
+ opt_hidden),
+ OPT_WITH_ARG("--hfa-hash-clock",
+ opt_set_intval, NULL, &opt_hfa_hash_clock,
+ opt_hidden),
+ OPT_WITHOUT_ARG("--hfa-pll-bypass",
+ opt_set_bool, &opt_hfa_pll_bypass,
+ opt_hidden),
+#endif
#ifdef USE_KLONDIKE
OPT_WITH_ARG("--klondike-options",
set_klondike_options, NULL, NULL,
diff --git a/driver-hashfast.c b/driver-hashfast.c
index 4f4a661..daa60d2 100644
--- a/driver-hashfast.c
+++ b/driver-hashfast.c
@@ -209,7 +209,7 @@ static const char *hf_usb_init_errors[] = {
static bool hfa_reset(struct cgpu_info *hashfast, struct hashfast_info *info)
{
- struct hf_usb_init_header usb_init, *hu = &usb_init;
+ struct hf_usb_init_header usb_init[2], *hu = usb_init;
struct hf_usb_init_base *db;
struct hf_usb_init_options *ho;
int retries = 0, i;
@@ -218,9 +218,9 @@ static bool hfa_reset(struct cgpu_info *hashfast, struct hashfast_info *info)
uint8_t hcrc;
bool ret;
- // XXX Following items need to be defaults with command-line overrides
- info->hash_clock_rate = 550; // Hash clock rate in Mhz
- info->group_ntime_roll = 1;
+ /* Hash clock rate in Mhz */
+ info->hash_clock_rate = opt_hfa_hash_clock ? opt_hfa_hash_clock : 550;
+ info->group_ntime_roll = opt_hfa_ntime_roll ? opt_hfa_ntime_roll : 1;
info->core_ntime_roll = 1;
// Assemble the USB_INIT request
@@ -228,6 +228,11 @@ static bool hfa_reset(struct cgpu_info *hashfast, struct hashfast_info *info)
hu->preamble = HF_PREAMBLE;
hu->operation_code = OP_USB_INIT;
hu->protocol = PROTOCOL_GLOBAL_WORK_QUEUE; // Protocol to use
+ // Force PLL bypass
+ if (opt_hfa_pll_bypass) {
+ hu->user_configuration = 1;
+ hu->pll_bypass = 1;
+ }
hu->hash_clock = info->hash_clock_rate; // Hash clock rate in Mhz
if (info->group_ntime_roll > 1 && info->core_ntime_roll) {
ho = (struct hf_usb_init_options *)(hu + 1);
diff --git a/driver-hashfast.h b/driver-hashfast.h
index cf6b7ad..5ce7234 100644
--- a/driver-hashfast.h
+++ b/driver-hashfast.h
@@ -16,6 +16,9 @@
#include "elist.h"
#include "hf_protocol.h"
+int opt_hfa_ntime_roll;
+int opt_hfa_hash_clock;
+bool opt_hfa_pll_bypass;
#define HASHFAST_MINER_THREADS 1
// Matching fields for hf_statistics, but large #s for local accumulation, per-die