Browse Source

Merge pull request #463 from nwoolls/feature/gridseed-blade-support

gridseed: added support for the 80-chip G-Blade Scrypt-only miner
Luke-Jr 11 years ago
parent
commit
6fa8aa0180
3 changed files with 9 additions and 3 deletions
  1. 6 2
      driver-gridseed.c
  2. 1 1
      gc3355.c
  3. 2 0
      gc3355.h

+ 6 - 2
driver-gridseed.c

@@ -94,11 +94,15 @@ bool gridseed_detect_custom(const char *path, struct device_drv *driver, struct
 		return false;
 	
 	device->device_fd = fd;
+
+	info->chips = GC3355_ORB_DEFAULT_CHIPS;
+	if((fw_version & 0xffff) == 0x1402)
+		info->chips = GC3355_BLADE_DEFAULT_CHIPS;
 	
 	gc3355_init_usborb(device->device_fd, info->freq, false, false);
 	
 	applog(LOG_INFO, "Found %"PRIpreprv" at %s", device->proc_repr, path);
-	applog(LOG_DEBUG, "%"PRIpreprv": Init: firmware=%"PRId64, device->proc_repr, fw_version);
+	applog(LOG_DEBUG, "%"PRIpreprv": Init: firmware=%"PRId64", chips=%d", device->proc_repr, fw_version, info->chips);
 	
 	return true;
 }
@@ -203,7 +207,7 @@ int64_t gridseed_estimate_hashes(struct thr_info *thr)
 	cgtime(&info->scanhash_time);
 	int elapsed_ms = ms_tdiff(&info->scanhash_time, &old_scanhash_time);
 
-	return GRIDSEED_HASH_SPEED * (double)elapsed_ms * (double)(info->freq * GC3355_ORB_DEFAULT_CHIPS);
+	return GRIDSEED_HASH_SPEED * (double)elapsed_ms * (double)(info->freq * info->chips);
 }
 
 // read from device for nonce or command

+ 1 - 1
gc3355.c

@@ -737,7 +737,7 @@ int64_t gc3355_get_firmware_version(int fd)
 		return -1;
 	}
 	
-	uint32_t fw_version = le32toh(*(uint32_t *)(buf + 8));
+	uint32_t fw_version = be32toh(*(uint32_t *)(buf + 8));
 	
 	return fw_version;
 }

+ 2 - 0
gc3355.h

@@ -28,11 +28,13 @@ int opt_pll_freq;
 
 #define GC3355_COMMAND_DELAY_MS 20
 #define GC3355_ORB_DEFAULT_CHIPS   5
+#define GC3355_BLADE_DEFAULT_CHIPS	40
 #define GC3355_READ_SIZE          12
 
 struct gc3355_orb_info
 {
 	uint16_t freq;
+	uint8_t chips;
 	struct timeval scanhash_time;
 };