Browse Source

Support new overclocking speeds for avalon: 325, 350 and 375

Conflicts:
	ASIC-README
Con Kolivas 12 years ago
parent
commit
d1e5435acf
2 changed files with 39 additions and 15 deletions
  1. 5 2
      README.ASIC
  2. 34 13
      driver-avalon.c

+ 5 - 2
README.ASIC

@@ -40,7 +40,10 @@ It is possible to set this a little lower if you are trying to tune for short
 block mining (eg p2pool) but much lower and the device will start creating
 duplicate shares.
 
-Sample settings for different frequencies (last 2 values):
+Sample settings for valid different frequencies (last 2 values):
+34:375
+36:350
+39:325
 43:300
 45:282
 47:270
@@ -48,7 +51,7 @@ Sample settings for different frequencies (last 2 values):
 
 Frequency:
 This is the clock speed of the devices. Only specific values work, 256, 270,
-282 (default) and 300.
+282 (default), 300, 325, 350 and 375.
 
 If you use the full curses based interface with Avalons you will get this
 information:

+ 34 - 13
driver-avalon.c

@@ -96,18 +96,36 @@ static int avalon_init_task(struct avalon_task *at,
 	buf[9] = 0x01;
 	buf[10] = 0x00;
 	buf[11] = 0x00;
-	if (frequency == 256) {
-		buf[6] = 0x03;
-		buf[7] = 0x08;
-	} else if (frequency == 270) {
-		buf[6] = 0x73;
-		buf[7] = 0x08;
-	} else if (frequency == 282) {
-		buf[6] = 0xd3;
-		buf[7] = 0x08;
-	} else if (frequency == 300) {
-		buf[6] = 0x63;
-		buf[7] = 0x09;
+	switch (frequency) {
+		case 256:
+			buf[6] = 0x03;
+			buf[7] = 0x08;
+			break;
+		default:
+		case 270:
+			buf[6] = 0x73;
+			buf[7] = 0x08;
+			break;
+		case 282:
+			buf[6] = 0xd3;
+			buf[7] = 0x08;
+			break;
+		case 300:
+			buf[6] = 0x63;
+			buf[7] = 0x09;
+			break;
+		case 325:
+			buf[6] = 0x28;
+			buf[7] = 0x0a;
+			break;
+		case 350:
+			buf[6] = 0xf0;
+			buf[7] = 0x0a;
+			break;
+		case 375:
+			buf[6] = 0xb8;
+			buf[7] = 0x0b;
+			break;
 	}
 
 	return 0;
@@ -508,11 +526,14 @@ static void get_options(int this_option_offset, int *baud, int *miner_count,
 					case 270:
 					case 282:
 					case 300:
+					case 325:
+					case 350:
+					case 375:
 						*frequency = tmp;
 						break;
 					default:
 						quit(1, "Invalid avalon-options for "
-							"frequency must be 256/270/282/300");
+							"frequency must be 256/270/282/300/325/350/375");
 					}
 				}
 			}