//--------------------------------------------------------------------------- // // SCSI Target Emulator RaSCSI (*^..^*) // for Raspberry Pi // // Powered by XM6 TypeG Technology. // Copyright (C) 2016-2020 GIMONS // [ GPIO-SCSI bus ] // //--------------------------------------------------------------------------- #if !defined(gpiobus_h) #define gpiobus_h #include "config.h" #include "scsi.h" //--------------------------------------------------------------------------- // // Connection method definitions // //--------------------------------------------------------------------------- //#define CONNECT_TYPE_STANDARD // Standard (SCSI logic, standard pin assignment) //#define CONNECT_TYPE_FULLSPEC // Full spec (SCSI logic, standard pin assignment) //#define CONNECT_TYPE_AIBOM // AIBOM version (positive logic, unique pin assignment) //#define CONNECT_TYPE_GAMERNIUM // GAMERnium.com version (standard logic, unique pin assignment) //--------------------------------------------------------------------------- // // Signal control logic and pin assignment customization // //--------------------------------------------------------------------------- //--------------------------------------------------------------------------- // // SIGNAL_CONTROL_MODE: Signal control mode selection // You can customize the signal control logic from Version 1.22 // // 0:SCSI logical specification // Conversion board using 74LS641-1 etc. directly connected or published on HP // True : 0V // False : Open collector output (disconnect from bus) // // 1:Negative logic specification (when using conversion board for negative logic -> SCSI logic) // There is no conversion board with this specification at this time // True : 0V -> (CONVERT) -> 0V // False : 3.3V -> (CONVERT) -> Open collector output // // 2:Positive logic specification (when using the conversion board for positive logic -> SCSI logic) // RaSCSI Adapter Rev.C @132sync etc. // // True : 3.3V -> (CONVERT) -> 0V // False : 0V -> (CONVERT) -> Open collector output // //--------------------------------------------------------------------------- //--------------------------------------------------------------------------- // // Control signal pin assignment setting // GPIO pin mapping table for control signals. // // Control signal: // PIN_ACT // Signal that indicates the status of processing SCSI command. // PIN_ENB // Signal that indicates the valid signal from start to finish. // PIN_TAD // Signal that indicates the input/output direction of the target signal (BSY,IO,CD,MSG,REG). // PIN_IND // Signal that indicates the input/output direction of the initiator signal (SEL, ATN, RST, ACK). // PIN_DTD // Signal that indicates the input/output direction of the data lines (DT0...DT7,DP). // //--------------------------------------------------------------------------- //--------------------------------------------------------------------------- // // Control signal output logic // 0V:FALSE 3.3V:TRUE // // ACT_ON // PIN_ACT signal // ENB_ON // PIN_ENB signal // TAD_IN // PIN_TAD This is the logic when inputting. // IND_IN // PIN_ENB This is the logic when inputting. // DTD_IN // PIN_ENB This is the logic when inputting. // //--------------------------------------------------------------------------- //--------------------------------------------------------------------------- // // SCSI signal pin assignment setting // GPIO pin mapping table for SCSI signals. // PIN_DT0~PIN_SEL // //--------------------------------------------------------------------------- #ifdef CONNECT_TYPE_STANDARD // // RaSCSI standard (SCSI logic, standard pin assignment) // #define CONNECT_DESC "STANDARD" // Startup message // Select signal control mode #define SIGNAL_CONTROL_MODE 0 // SCSI logical specification // Control signal pin assignment (-1 means no control) #define PIN_ACT 4 // ACTIVE #define PIN_ENB 5 // ENABLE #define PIN_IND -1 // INITIATOR CTRL DIRECTION #define PIN_TAD -1 // TARGET CTRL DIRECTION #define PIN_DTD -1 // DATA DIRECTION // Control signal output logic #define ACT_ON TRUE // ACTIVE SIGNAL ON #define ENB_ON TRUE // ENABLE SIGNAL ON #define IND_IN FALSE // INITIATOR SIGNAL INPUT #define TAD_IN FALSE // TARGET SIGNAL INPUT #define DTD_IN TRUE // DATA SIGNAL INPUT // SCSI signal pin assignment #define PIN_DT0 10 // Data 0 #define PIN_DT1 11 // Data 1 #define PIN_DT2 12 // Data 2 #define PIN_DT3 13 // Data 3 #define PIN_DT4 14 // Data 4 #define PIN_DT5 15 // Data 5 #define PIN_DT6 16 // Data 6 #define PIN_DT7 17 // Data 7 #define PIN_DP 18 // Data parity #define PIN_ATN 19 // ATN #define PIN_RST 20 // RST #define PIN_ACK 21 // ACK #define PIN_REQ 22 // REQ #define PIN_MSG 23 // MSG #define PIN_CD 24 // CD #define PIN_IO 25 // IO #define PIN_BSY 26 // BSY #define PIN_SEL 27 // SEL #endif #ifdef CONNECT_TYPE_FULLSPEC // // RaSCSI standard (SCSI logic, standard pin assignment) // #define CONNECT_DESC "FULLSPEC" // Startup message // Select signal control mode #define SIGNAL_CONTROL_MODE 0 // SCSI logical specification // Control signal pin assignment (-1 means no control) #define PIN_ACT 4 // ACTIVE #define PIN_ENB 5 // ENABLE #define PIN_IND 6 // INITIATOR CTRL DIRECTION #define PIN_TAD 7 // TARGET CTRL DIRECTION #define PIN_DTD 8 // DATA DIRECTION // Control signal output logic #define ACT_ON TRUE // ACTIVE SIGNAL ON #define ENB_ON TRUE // ENABLE SIGNAL ON #define IND_IN FALSE // INITIATOR SIGNAL INPUT #define TAD_IN FALSE // TARGET SIGNAL INPUT #define DTD_IN TRUE // DATA SIGNAL INPUT // SCSI signal pin assignment #define PIN_DT0 10 // Data 0 #define PIN_DT1 11 // Data 1 #define PIN_DT2 12 // Data 2 #define PIN_DT3 13 // Data 3 #define PIN_DT4 14 // Data 4 #define PIN_DT5 15 // Data 5 #define PIN_DT6 16 // Data 6 #define PIN_DT7 17 // Data 7 #define PIN_DP 18 // Data parity #define PIN_ATN 19 // ATN #define PIN_RST 20 // RST #define PIN_ACK 21 // ACK #define PIN_REQ 22 // REQ #define PIN_MSG 23 // MSG #define PIN_CD 24 // CD #define PIN_IO 25 // IO #define PIN_BSY 26 // BSY #define PIN_SEL 27 // SEL #endif #ifdef CONNECT_TYPE_AIBOM // // RaSCSI Adapter Aibom version // #define CONNECT_DESC "AIBOM PRODUCTS version" // Startup message // Select signal control mode #define SIGNAL_CONTROL_MODE 2 // SCSI positive logic specification // Control signal output logic #define ACT_ON TRUE // ACTIVE SIGNAL ON #define ENB_ON TRUE // ENABLE SIGNAL ON #define IND_IN FALSE // INITIATOR SIGNAL INPUT #define TAD_IN FALSE // TARGET SIGNAL INPUT #define DTD_IN FALSE // DATA SIGNAL INPUT // Control signal pin assignment (-1 means no control) #define PIN_ACT 4 // ACTIVE #define PIN_ENB 17 // ENABLE #define PIN_IND 27 // INITIATOR CTRL DIRECTION #define PIN_TAD -1 // TARGET CTRL DIRECTION #define PIN_DTD 18 // DATA DIRECTION // SCSI signal pin assignment #define PIN_DT0 6 // Data 0 #define PIN_DT1 12 // Data 1 #define PIN_DT2 13 // Data 2 #define PIN_DT3 16 // Data 3 #define PIN_DT4 19 // Data 4 #define PIN_DT5 20 // Data 5 #define PIN_DT6 26 // Data 6 #define PIN_DT7 21 // Data 7 #define PIN_DP 5 // Data parity #define PIN_ATN 22 // ATN #define PIN_RST 25 // RST #define PIN_ACK 10 // ACK #define PIN_REQ 7 // REQ #define PIN_MSG 9 // MSG #define PIN_CD 11 // CD #define PIN_IO 23 // IO #define PIN_BSY 24 // BSY #define PIN_SEL 8 // SEL #endif #ifdef CONNECT_TYPE_GAMERNIUM // // RaSCSI Adapter GAMERnium.com version // #define CONNECT_DESC "GAMERnium.com version"// Startup message // Select signal control mode #define SIGNAL_CONTROL_MODE 0 // SCSI logical specification // Control signal output logic #define ACT_ON TRUE // ACTIVE SIGNAL ON #define ENB_ON TRUE // ENABLE SIGNAL ON #define IND_IN FALSE // INITIATOR SIGNAL INPUT #define TAD_IN FALSE // TARGET SIGNAL INPUT #define DTD_IN TRUE // DATA SIGNAL INPUT // Control signal pin assignment (-1 means no control) #define PIN_ACT 14 // ACTIVE #define PIN_ENB 6 // ENABLE #define PIN_IND 7 // INITIATOR CTRL DIRECTION #define PIN_TAD 8 // TARGET CTRL DIRECTION #define PIN_DTD 5 // DATA DIRECTION // SCSI signal pin assignment #define PIN_DT0 21 // Data 0 #define PIN_DT1 26 // Data 1 #define PIN_DT2 20 // Data 2 #define PIN_DT3 19 // Data 3 #define PIN_DT4 16 // Data 4 #define PIN_DT5 13 // Data 5 #define PIN_DT6 12 // Data 6 #define PIN_DT7 11 // Data 7 #define PIN_DP 25 // Data parity #define PIN_ATN 10 // ATN #define PIN_RST 22 // RST #define PIN_ACK 24 // ACK #define PIN_REQ 15 // REQ #define PIN_MSG 17 // MSG #define PIN_CD 18 // CD #define PIN_IO 4 // IO #define PIN_BSY 27 // BSY #define PIN_SEL 23 // SEL #endif #define ALL_SCSI_PINS \ ((1<