瀏覽代碼

Add "turbo" speed mode.

Michael McMaster 8 年之前
父節點
當前提交
40e14a997b

+ 6 - 0
lib/SCSI2SD/CHANGELOG

@@ -1,3 +1,9 @@
+20170429		6.1.1
+	- Add new "turbo" speed mode to get faster async transfers.
+	- Fix scsi2sd-util6 size and sector-size inputs
+	- Fix crash when configured scsi disk starting sector is less than
+	SD card size
+
 20170329		6.1.0
 	- Enable synchronous transfers on SCSI1 hosts
 	- Support 4MB/s sync transfers for Amiga A590 (WD33C93)

+ 2 - 1
lib/SCSI2SD/include/scsi2sd.h

@@ -90,7 +90,8 @@ typedef enum
 	S2S_CFG_SPEED_ASYNC_33,
 	S2S_CFG_SPEED_ASYNC_50,
 	S2S_CFG_SPEED_SYNC_5,
-	S2S_CFG_SPEED_SYNC_10
+	S2S_CFG_SPEED_SYNC_10,
+	S2S_CFG_SPEED_TURBO
 } S2S_CFG_SPEED;
 
 typedef struct __attribute__((packed))

+ 1 - 1
lib/SCSI2SD/src/firmware/config.c

@@ -38,7 +38,7 @@
 
 #include <string.h>
 
-static const uint16_t FIRMWARE_VERSION = 0x0610;
+static const uint16_t FIRMWARE_VERSION = 0x0611;
 
 // 1 flash row
 static const uint8_t DEFAULT_CONFIG[128] =

+ 16 - 5
lib/SCSI2SD/src/firmware/scsiPhy.c

@@ -33,12 +33,16 @@ static uint8_t asyncTimings[][4] =
 /* Speed,    Assert,    Deskew,    Hold,    Glitch */
 {/*1.5MB/s*/ 28,        18,        13,      13},
 {/*3.3MB/s*/ 13,        6,         6,       13},
-{/*5MB/s*/   9,         6,         6,       6} // 80ns
+{/*5MB/s*/   9,         6,         6,       6}, // 80ns
+{/*safe*/    3,         6,         6,       6}, // Probably safe
+{/*turbo*/   3,         3,         3,       2}
 };
 
 #define SCSI_ASYNC_15 0
 #define SCSI_ASYNC_33 1
 #define SCSI_ASYNC_50 2
+#define SCSI_ASYNC_SAFE 3
+#define SCSI_ASYNC_TURBO 4
 
 // 5MB/s synchronous timing
 #define SCSI_FAST5_DESKEW 6 // 55ns
@@ -463,7 +467,7 @@ scsiSetTiming(
 static void
 scsiSetDefaultTiming()
 {
-	const uint8_t* asyncTiming = asyncTimings[3];
+	const uint8_t* asyncTiming = asyncTimings[0];
 	scsiSetTiming(
 		asyncTiming[0],
 		asyncTiming[1],
@@ -521,9 +525,16 @@ void scsiEnterPhase(int phase)
 			*SCSI_CTRL_SYNC_OFFSET = 0;
 			const uint8_t* asyncTiming;
 
-			if (scsiDev.boardCfg.scsiSpeed == S2S_CFG_SPEED_NoLimit ||
-				scsiDev.boardCfg.scsiSpeed >= S2S_CFG_SPEED_ASYNC_50) {
-
+			if (scsiDev.boardCfg.scsiSpeed == S2S_CFG_SPEED_NoLimit)
+			{
+				asyncTiming = asyncTimings[SCSI_ASYNC_SAFE];
+			}
+			else if (scsiDev.boardCfg.scsiSpeed >= S2S_CFG_SPEED_TURBO)
+			{
+				asyncTiming = asyncTimings[SCSI_ASYNC_TURBO];
+			}
+			else if (scsiDev.boardCfg.scsiSpeed >= S2S_CFG_SPEED_ASYNC_50)
+			{
 				asyncTiming = asyncTimings[SCSI_ASYNC_50];
 			} else if (scsiDev.boardCfg.scsiSpeed >= S2S_CFG_SPEED_ASYNC_33) {
 

+ 4 - 2
lib/SCSI2SD/src/scsi2sd-util6/BoardPanel.cc

@@ -66,11 +66,13 @@ BoardPanel::BoardPanel(wxWindow* parent, const S2S_BoardCfg& initialConfig) :
 
 	fgs->Add(new wxStaticText(this, wxID_ANY, _("SCSI Speed Limit")));
 	wxString speeds[] = {
-		wxT("No limit"),
+		wxT("No limit (safe)"),
 		wxT("Async, 1.5MB/s"),
 		wxT("Async, 3.3MB/s"),
 		wxT("Async, 5 MB/s"),
-		wxT("Sync, 5 MB/s")};
+		wxT("Sync, 5 MB/s"),
+		wxT("Sync, 10 MB/s"),
+		wxT("Turbo (less reliable)")};
 
 	myScsiSpeedCtrl =
 		new wxChoice(