Add "turbo" speed mode.
authorMichael McMaster <michael@codesrc.com>
Sat, 29 Apr 2017 05:38:49 +0000 (15:38 +1000)
committerMichael McMaster <michael@codesrc.com>
Sat, 29 Apr 2017 05:38:49 +0000 (15:38 +1000)
CHANGELOG
include/scsi2sd.h
src/firmware/config.c
src/firmware/scsiPhy.c
src/scsi2sd-util6/BoardPanel.cc

index 3c17ec2..1a82b9d 100644 (file)
--- a/CHANGELOG
+++ b/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)
index 6048e55..44eec49 100755 (executable)
@@ -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))
index edb4be0..e5451ec 100755 (executable)
@@ -38,7 +38,7 @@
 \r
 #include <string.h>\r
 \r
-static const uint16_t FIRMWARE_VERSION = 0x0610;\r
+static const uint16_t FIRMWARE_VERSION = 0x0611;\r
 \r
 // 1 flash row\r
 static const uint8_t DEFAULT_CONFIG[128] =\r
index c0f8cdb..488c33c 100755 (executable)
@@ -33,12 +33,16 @@ static uint8_t asyncTimings[][4] =
 /* Speed,    Assert,    Deskew,    Hold,    Glitch */\r
 {/*1.5MB/s*/ 28,        18,        13,      13},\r
 {/*3.3MB/s*/ 13,        6,         6,       13},\r
-{/*5MB/s*/   9,         6,         6,       6} // 80ns\r
+{/*5MB/s*/   9,         6,         6,       6}, // 80ns\r
+{/*safe*/    3,         6,         6,       6}, // Probably safe\r
+{/*turbo*/   3,         3,         3,       2}\r
 };\r
 \r
 #define SCSI_ASYNC_15 0\r
 #define SCSI_ASYNC_33 1\r
 #define SCSI_ASYNC_50 2\r
+#define SCSI_ASYNC_SAFE 3\r
+#define SCSI_ASYNC_TURBO 4\r
 \r
 // 5MB/s synchronous timing\r
 #define SCSI_FAST5_DESKEW 6 // 55ns\r
@@ -463,7 +467,7 @@ scsiSetTiming(
 static void\r
 scsiSetDefaultTiming()\r
 {\r
-       const uint8_t* asyncTiming = asyncTimings[3];\r
+       const uint8_t* asyncTiming = asyncTimings[0];\r
        scsiSetTiming(\r
                asyncTiming[0],\r
                asyncTiming[1],\r
@@ -521,9 +525,16 @@ void scsiEnterPhase(int phase)
                        *SCSI_CTRL_SYNC_OFFSET = 0;\r
                        const uint8_t* asyncTiming;\r
 \r
-                       if (scsiDev.boardCfg.scsiSpeed == S2S_CFG_SPEED_NoLimit ||\r
-                               scsiDev.boardCfg.scsiSpeed >= S2S_CFG_SPEED_ASYNC_50) {\r
-\r
+                       if (scsiDev.boardCfg.scsiSpeed == S2S_CFG_SPEED_NoLimit)\r
+                       {\r
+                               asyncTiming = asyncTimings[SCSI_ASYNC_SAFE];\r
+                       }\r
+                       else if (scsiDev.boardCfg.scsiSpeed >= S2S_CFG_SPEED_TURBO)\r
+                       {\r
+                               asyncTiming = asyncTimings[SCSI_ASYNC_TURBO];\r
+                       }\r
+                       else if (scsiDev.boardCfg.scsiSpeed >= S2S_CFG_SPEED_ASYNC_50)\r
+                       {\r
                                asyncTiming = asyncTimings[SCSI_ASYNC_50];\r
                        } else if (scsiDev.boardCfg.scsiSpeed >= S2S_CFG_SPEED_ASYNC_33) {\r
 \r
index 157435b..e7a3b19 100644 (file)
@@ -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(