|
|
@@ -275,7 +275,12 @@ extern "C" uint32_t scsiEnterPhaseImmediate(int phase)
|
|
|
if (scsiDev.compatMode < COMPAT_SCSI2)
|
|
|
{
|
|
|
// EMU EMAX needs 100uS ! 10uS is not enough.
|
|
|
- delayNs += 100000;
|
|
|
+ // However, Xebec controllers don't need this delay and can cause blocks
|
|
|
+ if (scsiDev.target && scsiDev.target->cfg &&
|
|
|
+ scsiDev.target->cfg->quirks != S2S_CFG_QUIRKS_XEBEC)
|
|
|
+ {
|
|
|
+ delayNs += 100000;
|
|
|
+ }
|
|
|
}
|
|
|
|
|
|
return delayNs;
|
|
|
@@ -295,7 +300,18 @@ void scsiEnterBusFree(void)
|
|
|
g_scsi_ctrl_bsy = 0;
|
|
|
scsiDev.cdbLen = 0;
|
|
|
|
|
|
- SCSI_RELEASE_OUTPUTS();
|
|
|
+ // Conditional GPIO release based on controller type
|
|
|
+ if (scsiDev.target && scsiDev.target->cfg &&
|
|
|
+ scsiDev.target->cfg->quirks == S2S_CFG_QUIRKS_XEBEC)
|
|
|
+ {
|
|
|
+ // Xebec controllers: Use optimized timing with 200ns delay
|
|
|
+ SCSI_RELEASE_OUTPUTS_XEBEC(); // ~300ns: Uses delay_ns(200) instead of delay(1ms)
|
|
|
+ }
|
|
|
+ else
|
|
|
+ {
|
|
|
+ // Standard/legacy controllers: Use conservative 1ms delay
|
|
|
+ SCSI_RELEASE_OUTPUTS(); // ~1,000,150ns: Contains 1ms delay for compatibility
|
|
|
+ }
|
|
|
}
|
|
|
|
|
|
/********************/
|