Browse Source

Merge branch 'dev_x6500' into bfgminer

Luke Dashjr 13 years ago
parent
commit
6085550afc
6 changed files with 33 additions and 3 deletions
  1. 14 0
      FPGA-README
  2. 1 0
      README
  3. 5 0
      driver-modminer.c
  4. 5 0
      driver-x6500.c
  5. 7 3
      miner.c
  6. 1 0
      miner.h

+ 14 - 0
FPGA-README

@@ -186,3 +186,17 @@ The increase is, however, extremely small and the actual increase is reported wi
 RPC API 'stats' command (a very slow CPU will make it more noticeable)
 Using the 'short' mode will remove this delay after 'short' mode completes
 The delay doesn't affect the calculation of the correct hash time
+
+
+X6500
+
+Since X6500 FPGAs do not use serial ports for communication, the --scan-serial
+option instead works with product serial numbers. By default, any devices with
+the X6500 USB product id will be used, but some X6500s may have shipped without
+this product id being configured. If you have any of these, you will need to
+specify their serial numbers explicitly, and also add -S x6500:auto if you
+still want to use the autodetection for other properly-configured FPGAs.
+The serial number of X6500s is usually found on a label applied to the ATX
+power connector slot. If yours is missing, devices seen by the system can be
+displayed by starting bfgminer in debug mode. To get a simple list of devices,
+with the debug output shown, you can use: bfgminer -D -d? -T

+ 1 - 0
README

@@ -143,6 +143,7 @@ Options for both config file and command line:
 --expiry|-E <arg>   Upper bound on how many seconds after getting work we consider a share from it stale (w/o longpoll active) (default: 120)
 --expiry-lp <arg>   Upper bound on how many seconds after getting work we consider a share from it stale (with longpoll active) (default: 3600)
 --failover-only     Don't leak work to backup pools when primary pool is lagging
+--force-dev-init    Always initialize devices when possible (such as bitstream uploads to some FPGAs)
 --kernel-path|-K <arg> Specify a path to where bitstream and kernel files are (default: "/usr/local/bin")
 --load-balance      Change multipool strategy from failover to efficiency based balance
 --log|-l <arg>      Interval in seconds between log output (default: 5)

+ 5 - 0
driver-modminer.c

@@ -379,6 +379,11 @@ modminer_fpga_init(struct thr_info *thr)
 		applog(LOG_ERR, "%s %u.%u: FPGA not programmed", modminer->api->name, modminer->device_id, fpgaid);
 		if (!modminer_fpga_upload_bitstream(modminer))
 			return false;
+	} else if (opt_force_dev_init && modminer->status == LIFE_INIT) {
+		applog(LOG_DEBUG, "%s %u.%u: FPGA is already programmed, but --force-dev-init is set",
+		       modminer->api->name, modminer->device_id, fpgaid);
+		if (!modminer_fpga_upload_bitstream(modminer))
+			return false;
 	}
 	else
 		applog(LOG_DEBUG, "%s %u.%u: FPGA is already programmed :)", modminer->api->name, modminer->device_id, fpgaid);

+ 5 - 0
driver-x6500.c

@@ -368,6 +368,11 @@ static bool x6500_fpga_init(struct thr_info *thr)
 		       x6500->api->name, x6500->device_id, fpgaid);
 		if (!x6500_fpga_upload_bitstream(x6500, jp))
 			return false;
+	} else if (opt_force_dev_init && x6500->status == LIFE_INIT) {
+		applog(LOG_DEBUG, "%s %u.%u: FPGA is already programmed, but --force-dev-init is set",
+		       x6500->api->name, x6500->device_id, fpgaid);
+		if (!x6500_fpga_upload_bitstream(x6500, jp))
+			return false;
 	} else
 		applog(LOG_DEBUG, "%s %u.%u: FPGA is already programmed :)",
 		       x6500->api->name, x6500->device_id, fpgaid);

+ 7 - 3
miner.c

@@ -70,11 +70,9 @@
 #include "scrypt.h"
 #endif
 
-#if defined(USE_BITFORCE) || defined(USE_ICARUS) || defined(USE_MODMINER)
+#if defined(USE_BITFORCE) || defined(USE_ICARUS) || defined(USE_MODMINER) || defined(USE_X6500) || defined(USE_ZTEX)
 #	define USE_FPGA
 #	define USE_FPGA_SERIAL
-#elif defined(USE_ZTEX) || defined(USE_X6500)
-#	define USE_FPGA
 #endif
 
 enum workio_commands {
@@ -153,6 +151,7 @@ bool opt_restart = true;
 static bool opt_nogpu;
 
 struct list_head scan_devices;
+bool opt_force_dev_init;
 static signed int devices_enabled;
 static bool opt_removedisabled;
 int total_devices;
@@ -1130,6 +1129,11 @@ static struct opt_table opt_config_table[] = {
 	OPT_WITHOUT_ARG("--failover-only",
 			opt_set_bool, &opt_fail_only,
 			"Don't leak work to backup pools when primary pool is lagging"),
+#ifdef USE_FPGA
+	OPT_WITHOUT_ARG("--force-dev-init",
+	        opt_set_bool, &opt_force_dev_init,
+	        "Always initialize devices when possible (such as bitstream uploads to some FPGAs)"),
+#endif
 #ifdef HAVE_OPENCL
 	OPT_WITH_ARG("--gpu-dyninterval",
 		     set_int_1_to_65535, opt_show_intval, &opt_dynamic_interval,

+ 1 - 0
miner.h

@@ -783,6 +783,7 @@ extern void add_pool_details(struct pool *pool, bool live, char *url, char *user
 #endif
 
 extern struct list_head scan_devices;
+extern bool opt_force_dev_init;
 extern int nDevs;
 extern int opt_n_threads;
 extern int num_processors;