Revert "Hashfast voltage support" This reverts commit ef97e80a14240c95a7d2966abe462b12f7d4bf03.
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 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211
diff --git a/ASIC-README b/ASIC-README
index 53dac36..6019325 100644
--- a/ASIC-README
+++ b/ASIC-README
@@ -236,7 +236,7 @@ ASIC SPECIFIC COMMANDS
--hfa-fan <arg> Set fanspeed percentage for hashfast, single value or range (default: 10-85)
--hfa-name <arg> Set a unique name for a single hashfast device specified with --usb or the first device found
--hfa-noshed Disable hashfast dynamic core disabling feature
---hfa-options <arg> Set hashfast options name:clock or name:clock@voltage (comma separated)
+--hfa-options <arg> Set hashfast options name:clock (comma separated)
--hfa-temp-overheat <arg> Set the hashfast overheat throttling temperature (default: 95)
--hfa-temp-target <arg> Set the hashfast target temperature (0 to disable) (default: 88)
--klondike-options <arg> Set klondike options clock:temptarget
@@ -606,22 +606,20 @@ If you wished to name the second device Slug you would add the commands:
Newer firmwares on hashfast devices dynamically disable cores that generate
invalid data. This command will disable this feature where possible.
---hfa-options <arg> Set hashfast options name:clock or clock@voltage (comma separated)
+--hfa-options <arg> Set hashfast options name:clock (comma separated)
This command allows you to set options for each discrete hashfast device by
its name (if the firmware has naming support, i.e. version 0.3+). Currently
-this takes as option the clock speed alone or clock speed and voltage,
-although future options may be added.
+this takes only one option, the clock speed, although future options may be
+added.
e.g.:
---hfa-options "rabbit:650,turtle:550@800"
+--hfa-options "rabbit:650,turtle:550"
-Would set a device named rabbit to clock speed 650 MHz using default voltage
-and the one named turtle to 550 MHz using a voltage of 800 mv. Starting the
-device at a speed where it is most stable will give more reliable hashrates
-long term and prevent it interacting with other devices, rather than depending
-on the clockdown feature in cgminer.
+Would set a device named rabbit to clock speed 650 and the one named turtle to
+550. Starting the device at a speed where it is most stable will give more
+reliable hashrates long term and prevent it interacting with other devices,
+rather than depending on the clockdown feature in cgminer.
-Note: Setting voltage cause a board reset and hotplug event on cgminer startup.
Other undocumented hashfast command line options are for development purposes
only at this stage and serve no useful purpose to end users.
diff --git a/driver-hashfast.c b/driver-hashfast.c
index a26c518..01083e5 100644
--- a/driver-hashfast.c
+++ b/driver-hashfast.c
@@ -181,30 +181,6 @@ retry:
return true;
}
-static bool hfa_send_generic_frame(struct cgpu_info *hashfast, uint8_t opcode, uint8_t chip_address,
- uint8_t core_address, uint16_t hdata, uint8_t *data, int len)
-{
- uint8_t packet[256];
- struct hf_header *p = (struct hf_header *)packet;
- int tx_length, ret, amount;
-
- p->preamble = HF_PREAMBLE;
- p->operation_code = opcode;
- p->chip_address = chip_address;
- p->core_address = core_address;
- p->hdata = htole16(hdata);
- p->data_length = len / 4;
- p->crc8 = hfa_crc8(packet);
-
- if (len)
- memcpy(&packet[sizeof(struct hf_header)], data, len);
- tx_length = sizeof(struct hf_header) + len;
-
- ret = usb_write(hashfast, (char *)packet, tx_length, &amount, C_NULL);
-
- return ((ret >= 0) && (amount == tx_length));
-}
-
static bool hfa_send_frame(struct cgpu_info *hashfast, uint8_t opcode, uint16_t hdata,
uint8_t *data, int len)
{
@@ -394,47 +370,6 @@ static void hfa_choose_opname(struct cgpu_info *hashfast, struct hashfast_info *
hfa_write_opname(hashfast, info);
}
-// Generic setting header
-struct hf_settings_data {
- uint8_t revision;
- uint8_t ref_frequency;
- uint16_t magic;
- uint16_t frequency0;
- uint16_t voltage0;
- uint16_t frequency1;
- uint16_t voltage1;
- uint16_t frequency2;
- uint16_t voltage2;
- uint16_t frequency3;
- uint16_t voltage3;
-} __attribute__((packed,aligned(4)));
-
-static bool hfa_set_voltages(struct cgpu_info *hashfast, struct hashfast_info *info)
-{
- uint16_t magic = 0x42AA;
- struct hf_settings_data op_settings_data;
-
- op_settings_data.revision = 1;
- op_settings_data.ref_frequency = 25;
- op_settings_data.magic = magic;
-
- op_settings_data.frequency0 = info->hash_clock_rate;
- op_settings_data.voltage0 = info->hash_voltage;
- op_settings_data.frequency1 = info->hash_clock_rate;
- op_settings_data.voltage1 = info->hash_voltage;
- op_settings_data.frequency2 = info->hash_clock_rate;
- op_settings_data.voltage2 = info->hash_voltage;
- op_settings_data.frequency3 = info->hash_clock_rate;
- op_settings_data.voltage3 = info->hash_voltage;
-
- hfa_send_generic_frame(hashfast, OP_SETTINGS, 0x00, 0x01, magic, (uint8_t *)&op_settings_data, sizeof(op_settings_data));
- // reset the board once to switch to new voltage settings
- hfa_send_generic_frame(hashfast, OP_POWER, 0xff, 0x00, 0x1, NULL, 0);
- hfa_send_generic_frame(hashfast, OP_POWER, 0xff, 0x00, 0x2, NULL, 0);
-
- return true;
-}
-
static bool hfa_send_shutdown(struct cgpu_info *hashfast);
static bool hfa_reset(struct cgpu_info *hashfast, struct hashfast_info *info)
@@ -710,7 +645,7 @@ static void hfa_set_clock(struct cgpu_info *hashfast, struct hashfast_info *info
* to be added in the future. */
static void hfa_check_options(struct hashfast_info *info)
{
- char *p, *options, *found = NULL, *marker;
+ char *p, *options, *found = NULL;
int maxlen, option = 0;
if (!opt_hfa_options)
@@ -753,17 +688,6 @@ static void hfa_check_options(struct hashfast_info *info)
break;
}
info->hash_clock_rate = lval;
- marker = strchr(p,'@');
- if (marker != NULL) {
- lval = strtol(marker+1, NULL, 10);
- if (lval < HFA_VOLTAGE_MIN || lval > HFA_VOLTAGE_MAX) {
- applog(LOG_ERR, "Invalid core voltage %ld set with hashfast option for %s",
- lval, info->op_name);
- break;
- }
- info->hash_voltage = lval;
- info->set_voltage_needed = true;
- }
break;
}
}
@@ -1300,7 +1224,6 @@ static void *hfa_read(void *arg)
case OP_USB_NOTICE:
hfa_parse_notice(hashfast, h);
break;
- case OP_POWER:
case OP_PING:
/* Do nothing */
break;
@@ -1397,13 +1320,6 @@ static bool hfa_init(struct thr_info *thr)
}
}
- if (info->set_voltage_needed) {
- applog(LOG_NOTICE, "%s: Set default clock and voltage to %dMHz@%dmV",
- hashfast->drv->name, info->hash_clock_rate, info->hash_voltage);
- hfa_set_voltages(hashfast, info);
- info->set_voltage_needed = false;
- }
-
mutex_init(&info->lock);
mutex_init(&info->rlock);
if (pthread_create(&info->read_thr, NULL, hfa_read, (void *)thr))
@@ -1423,7 +1339,7 @@ out:
hashfast->device_data = NULL;
usb_nodev(hashfast);
}
-
+
return ret;
}
diff --git a/driver-hashfast.h b/driver-hashfast.h
index 28cda1a..d204c83 100644
--- a/driver-hashfast.h
+++ b/driver-hashfast.h
@@ -43,12 +43,6 @@ char *opt_hfa_options;
#define HFA_FAN_DEFAULT 33
#define HFA_FAN_MAX 85
#define HFA_FAN_MIN 5
-#define HFA_VOLTAGE_MAX 1000
-#define HFA_VOLTAGE_MIN 500
-
-// # Factory Operation Codes
-#define OP_SETTINGS 55 // Read or write settings
-#define OP_POWER 57
// Matching fields for hf_statistics, but large #s for local accumulation, per-die
struct hf_long_statistics {
@@ -151,8 +145,6 @@ struct hashfast_info {
int fanspeed; // Fanspeed in percent
int last_die_adjusted;
int clock_offset;
- int hash_voltage; // Hash voltage to use, in mV
- bool set_voltage_needed;
pthread_t read_thr;
time_t last_restart;