Browse Source

Add an --avalon-temp option to allow a user specified target temperature.

Con Kolivas 12 years ago
parent
commit
1fca632f7c
5 changed files with 40 additions and 17 deletions
  1. 17 5
      ASIC-README
  2. 2 1
      README
  3. 9 1
      cgminer.c
  4. 11 10
      driver-avalon.c
  5. 1 0
      driver-avalon.h

+ 17 - 5
ASIC-README

@@ -77,8 +77,17 @@ a preinstalled version of cgminer as part of the flash firmware, based on the
 most current cgminer version so no configuration should be necessary. It is
 most current cgminer version so no configuration should be necessary. It is
 possible to plug a USB cable from a PC into the Avalon device and mine using
 possible to plug a USB cable from a PC into the Avalon device and mine using
 cgminer as per any other device. It will autodetect and hotplug using default
 cgminer as per any other device. It will autodetect and hotplug using default
-options. You can customise the avalon behaviour by using the --avalon-options
-command.
+options. You can customise the avalon behaviour by using the avalon-options
+command, and adjust its fan control-temperature relationship with avalon-temp.
+
+eg:
+--avalon-temp 50
+
+This will adjust fanspeed to keep the temperature at or slightly below 50.
+If you wish the fans to run at maximum speed, setting the target temperature
+very low such as 0 will achieve this. This option can be added to the "More
+options" entry in the web interface if you do not have a direct way of setting
+it.
 
 
 eg:
 eg:
 --avalon-options 115200:24:10:45:282
 --avalon-options 115200:24:10:45:282
@@ -104,9 +113,9 @@ block mining (eg p2pool) but much lower and the device will start creating
 duplicate shares.
 duplicate shares.
 
 
 Sample settings for valid different frequencies (last 2 values):
 Sample settings for valid different frequencies (last 2 values):
-34:375
-36:350
-39:325
+34:375 *
+36:350 *
+39:325 *
 43:300
 43:300
 45:282 (default)
 45:282 (default)
 47:270
 47:270
@@ -116,6 +125,9 @@ Frequency:
 This is the clock speed of the devices. Only specific values work, 256, 270,
 This is the clock speed of the devices. Only specific values work, 256, 270,
 282 (default), 300, 325, 350 and 375.
 282 (default), 300, 325, 350 and 375.
 
 
+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.
+
 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:
 AVA 0: 22/ 46C  2400R
 AVA 0: 22/ 46C  2400R

+ 2 - 1
README

@@ -233,7 +233,8 @@ See SCRYPT-README for more information regarding litecoin mining.
 ASIC and FPGA mining boards (BFL ASIC, BitForce, Icarus, ModMiner, Ztex)
 ASIC and FPGA mining boards (BFL ASIC, BitForce, Icarus, ModMiner, Ztex)
 only options:
 only options:
 
 
---avalon-options    (See ASIC-README)
+--avalon-options <arg> Set avalon options baud:miners:asic:timeout:freq
+--avalon-temp <arg> Set avalon target temperature (default: 45)
 --bfl-range         Use nonce range on bitforce devices if supported
 --bfl-range         Use nonce range on bitforce devices if supported
 --icarus-options <arg> Set specific FPGA board configurations - one set of values for all or comma separated
 --icarus-options <arg> Set specific FPGA board configurations - one set of values for all or comma separated
 --icarus-timing <arg> Set how the Icarus timing is calculated - one setting/value for all or comma separated
 --icarus-timing <arg> Set how the Icarus timing is calculated - one setting/value for all or comma separated

+ 9 - 1
cgminer.c

@@ -568,6 +568,11 @@ static char *set_int_0_to_10(const char *arg, int *i)
 	return set_int_range(arg, i, 0, 10);
 	return set_int_range(arg, i, 0, 10);
 }
 }
 
 
+static char *set_int_0_to_100(const char *arg, int *i)
+{
+	return set_int_range(arg, i, 0, 100);
+}
+
 static char *set_int_1_to_10(const char *arg, int *i)
 static char *set_int_1_to_10(const char *arg, int *i)
 {
 {
 	return set_int_range(arg, i, 1, 10);
 	return set_int_range(arg, i, 1, 10);
@@ -1052,7 +1057,10 @@ static struct opt_table opt_config_table[] = {
 #ifdef USE_AVALON
 #ifdef USE_AVALON
 	OPT_WITH_ARG("--avalon-options",
 	OPT_WITH_ARG("--avalon-options",
 		     set_avalon_options, NULL, NULL,
 		     set_avalon_options, NULL, NULL,
-		     opt_hidden),
+		     "Set avalon options baud:miners:asic:timeout:freq"),
+	OPT_WITH_ARG("--avalon-temp",
+		     set_int_0_to_100, opt_show_intval, &opt_avalon_temp,
+		     "Set avalon target temperature"),
 #endif
 #endif
 	OPT_WITHOUT_ARG("--load-balance",
 	OPT_WITHOUT_ARG("--load-balance",
 		     set_loadbalance, &pool_strategy,
 		     set_loadbalance, &pool_strategy,

+ 11 - 10
driver-avalon.c

@@ -40,6 +40,7 @@
 #include "hexdump.c"
 #include "hexdump.c"
 #include "util.h"
 #include "util.h"
 
 
+int opt_avalon_temp = AVALON_TEMP_TARGET;
 static int option_offset = -1;
 static int option_offset = -1;
 struct device_drv avalon_drv;
 struct device_drv avalon_drv;
 
 
@@ -986,15 +987,15 @@ static inline void record_temp_fan(struct avalon_info *info, struct avalon_resul
 
 
 static void temp_rise(struct avalon_info *info, int temp)
 static void temp_rise(struct avalon_info *info, int temp)
 {
 {
-	if (temp >= AVALON_TEMP_TARGET + AVALON_TEMP_HYSTERESIS * 3) {
+	if (temp >= opt_avalon_temp + AVALON_TEMP_HYSTERESIS * 3) {
 		info->fan_pwm = AVALON_DEFAULT_FAN_MAX_PWM;
 		info->fan_pwm = AVALON_DEFAULT_FAN_MAX_PWM;
 		return;
 		return;
 	}
 	}
-	if (temp >= AVALON_TEMP_TARGET + AVALON_TEMP_HYSTERESIS * 2)
+	if (temp >= opt_avalon_temp + AVALON_TEMP_HYSTERESIS * 2)
 		info->fan_pwm += 10;
 		info->fan_pwm += 10;
-	else if (temp > AVALON_TEMP_TARGET)
+	else if (temp > opt_avalon_temp)
 		info->fan_pwm += 5;
 		info->fan_pwm += 5;
-	else if (temp >= AVALON_TEMP_TARGET - AVALON_TEMP_HYSTERESIS)
+	else if (temp >= opt_avalon_temp - AVALON_TEMP_HYSTERESIS)
 		info->fan_pwm += 1;
 		info->fan_pwm += 1;
 	else
 	else
 		return;
 		return;
@@ -1005,15 +1006,15 @@ static void temp_rise(struct avalon_info *info, int temp)
 
 
 static void temp_drop(struct avalon_info *info, int temp)
 static void temp_drop(struct avalon_info *info, int temp)
 {
 {
-	if (temp <= AVALON_TEMP_TARGET - AVALON_TEMP_HYSTERESIS * 3) {
+	if (temp <= opt_avalon_temp - AVALON_TEMP_HYSTERESIS * 3) {
 		info->fan_pwm = AVALON_DEFAULT_FAN_MIN_PWM;
 		info->fan_pwm = AVALON_DEFAULT_FAN_MIN_PWM;
 		return;
 		return;
 	}
 	}
-	if (temp <= AVALON_TEMP_TARGET - AVALON_TEMP_HYSTERESIS * 2)
+	if (temp <= opt_avalon_temp - AVALON_TEMP_HYSTERESIS * 2)
 		info->fan_pwm -= 10;
 		info->fan_pwm -= 10;
-	else if (temp <= AVALON_TEMP_TARGET - AVALON_TEMP_HYSTERESIS)
+	else if (temp <= opt_avalon_temp - AVALON_TEMP_HYSTERESIS)
 		info->fan_pwm -= 5;
 		info->fan_pwm -= 5;
-	else if (temp < AVALON_TEMP_TARGET)
+	else if (temp < opt_avalon_temp)
 		info->fan_pwm -= 1;
 		info->fan_pwm -= 1;
 
 
 	if (info->fan_pwm < AVALON_DEFAULT_FAN_MIN_PWM)
 	if (info->fan_pwm < AVALON_DEFAULT_FAN_MIN_PWM)
@@ -1032,9 +1033,9 @@ static inline void adjust_fan(struct avalon_info *info)
 		temp_drop(info, temp_new);
 		temp_drop(info, temp_new);
 	else {
 	else {
 		/* temp_new == info->temp_old */
 		/* temp_new == info->temp_old */
-		if (temp_new > AVALON_TEMP_TARGET)
+		if (temp_new > opt_avalon_temp)
 			temp_rise(info, temp_new);
 			temp_rise(info, temp_new);
-		else if (temp_new < AVALON_TEMP_TARGET - AVALON_TEMP_HYSTERESIS)
+		else if (temp_new < opt_avalon_temp - AVALON_TEMP_HYSTERESIS)
 			temp_drop(info, temp_new);
 			temp_drop(info, temp_new);
 	}
 	}
 	info->temp_old = temp_new;
 	info->temp_old = temp_new;

+ 1 - 0
driver-avalon.h

@@ -138,6 +138,7 @@ struct avalon_info {
 ASSERT1(sizeof(uint32_t) == 4);
 ASSERT1(sizeof(uint32_t) == 4);
 
 
 extern struct avalon_info **avalon_info;
 extern struct avalon_info **avalon_info;
+extern int opt_avalon_temp;
 
 
 #endif /* USE_AVALON */
 #endif /* USE_AVALON */
 #endif	/* AVALON_H */
 #endif	/* AVALON_H */