Commit Graph

45 Commits

Author SHA1 Message Date
joevt
61576d4032 sc53c94: Check drq_cb. 2024-04-03 19:35:58 -07:00
joevt
782a8d2c3c sc53c94: CMD_COMPLETE_STEPS includes INTSTAT_SO.
Last step of CMD_COMPLETE_STEPS includes INTSTAT_SO to indicate to CurioSCSIController::fsmCompleting that it returned both a status byte and a message byte in the FIFO.
2024-04-03 19:35:27 -07:00
joevt
e619dd2493 sc53c94: CMD_COMPLETE and XFER_END goes to IDLE.
CMD_COMPLETE and XFER_END goes to the IDLE sequence state so that reentry doesn't cause a second interrupt.
2024-04-03 19:35:13 -07:00
joevt
8a1055ed1b sc53c94: Add DBDMA support.
- For pdm/amic, real_dma_xfer is called when SCSI_DMA_Ctrl has the run bit set.
- For tnt/grandcentral, dma_wait is called when the DBDMA is started (run bit is set). It will call real_dma_xfer when the phase and sequence are DATA_IN/RCV_DATA or DATA_OUT/SEND_DATA.
- dma_wait and real_dma_xfer uses a one shot timer instead of a loop to continue doing DMA while also giving time to the CPU. This and the above changes handles the case where the DBDMA is started before setting up the transfer phase and sequence.
- dma_stop will stop the one shot timer when the DBDMA channel is stopped.
2024-04-03 19:19:42 -07:00
joevt
ff766b10eb sc53c94: Add seq_id to sequence descriptor.
The seq_id can be used for logging the current command and step number.
2024-04-03 18:43:46 -07:00
joevt
ceb2276098 sc53c94: Move chip_id to xfer_count.
Method for reading chip_id needs verification.
2024-04-03 18:43:40 -07:00
joevt
82f4d05f4b sc53c94: Set timer_id to zero.
If a timer is not in progress then set its timer_id to zero. Also, don't start a newer timer if an existing one is still in progress.
2024-04-03 18:36:53 -07:00
joevt
8a81cb4f9c sc53c94: Use enums. 2024-04-03 18:12:00 -07:00
joevt
1504bd2227 sc53c94: Move DATA_FIFO_MAX from header.
Headers shouldn't make defines that are not meant to be used outside the source file.
2024-04-03 18:11:07 -07:00
joevt
02a475e113 sc53c94: Remove duplicate bus_obj.
sc53c94 is a ScsiDevice which has its own bus_obj which is set by register_device.
2024-03-30 11:56:59 -07:00
joevt
fd961f9ff9 Fix Analyzer warnings.
In Xcode, type Command-Shift-B to analyze every source file or Command-Shift-Control-B to analyze the current source file.

For pseudo_dma_read report FIFO underrun and init data_word in that case.
2024-03-24 12:56:11 -07:00
joevt
45a9d45e3f Add SCSI devices.
scsibus has a new method attach_scsi_devices which is used by all machines to populate a SCSI bus with one or more hard drives or CD-ROM drives.

HDDs are specified by the hdd_img property.
CDs are specified by the cdr_img property.
Multiple images are delimited by a colon :

attach_scsi_devices is called by the scsi controller after the scsi controller has attached itself to the scsi bus.
The bus suffix is applied to the property name.
Curio has no suffix so it will use hdd_img and cdr_img properties.
Mesh is expected to have a suffix of 2 so it will use hdd_img2 and cdr_img2 properties.

HDDs will skip SCSI ID 3 unless 7 HDDs are added, in which case, the seventh HDD will use ID 3.
CDs will start at SCSI ID 3, go to 7, then down to 0.
SCSI IDs are skipped if a device is already using that SCSI ID.

ScsiCdrom and ScsiHD no longer use REGISTER_DEVICE or DeviceDescription or PropMap which is normal for devices that can have multiple instances.
2024-03-14 19:12:11 -07:00
joevt
e1e00c951b sc53c94: Split real_dma_xfer.
Create real_dma_xfer_out and real_dma_xfer_in methods.
2024-03-14 08:01:07 -07:00
joevt
1e78512c95 Rename Curio and Mesh. 2024-03-02 11:12:45 -07:00
Maxim Poliakovski
f5bb484226 sc53c94: fix interrupt reporting. 2024-02-19 15:30:20 +01:00
Maxim Poliakovski
5902cd5c28 Wire SCSI_CURIO interrupt. 2024-02-12 01:46:21 +01:00
Maxim Poliakovski
65a343ce5c Clean up names for SCSI devices. 2023-12-04 22:41:01 +01:00
Maxim Poliakovski
1e4579a076 Improve SCSI state machine. 2023-12-04 21:41:55 +01:00
Maxim Poliakovski
58281520d3 Implement writes to SCSI Pseudo-DMA register. 2023-12-04 21:41:55 +01:00
Maxim Poliakovski
94872b3ebb Store SCSI bus object pointer during registration. 2023-11-24 19:48:07 +01:00
Maxim Poliakovski
9ae863d7c4 sc53c94: add is_dma_cmd member variable. 2023-11-24 19:48:07 +01:00
Mihai Parparita
35c86ad6bf Clean up #includes
Result of running IWYU (https://include-what-you-use.org/) and
applying most of the suggestions about unncessary includes and
forward declarations.

Was motivated by observing that <thread> was being included in
ppcopcodes.cpp even though it was unused (found while researching
the use of threads), but seems generally good to help with build
times and correctness.
2023-11-03 00:33:47 -07:00
Maxim Poliakovski
f809124a2e Improve SCSI bus registration. 2023-05-30 19:46:27 +02:00
Maxim Poliakovski
3de89eaaf7 Silence SCSI logging messages. 2022-11-08 00:33:38 +01:00
Maxim Poliakovski
2f02ea4276 sc53c94: release ATN line after MESSAGE_OUT. 2022-11-08 00:30:19 +01:00
Maxim Poliakovski
b2ef809de1 scsi_hd: fix write command. 2022-11-07 22:04:02 +01:00
Maxim Poliakovski
a00b87790b sc3c94: implement real DMA. 2022-11-07 12:34:55 +01:00
Maxim Poliakovski
ca5f81417f sc53c94: refactor state machine. 2022-11-07 12:34:42 +01:00
Maxim Poliakovski
0c4da80c93 sc53c94: small cosmetic fixes. 2022-11-02 23:23:37 +01:00
Maxim Poliakovski
5a59b97257 Sc53C94: implement cycle completion commands. 2022-11-02 22:28:43 +01:00
Maxim Poliakovski
2865a611e7 Sc53C94: implement reading the FIFO register. 2022-11-02 21:19:31 +01:00
Maxim Poliakovski
2c3a5c3b8f Sc53C94: reading current transfer count. 2022-11-01 02:12:09 +01:00
Maxim Poliakovski
c54c1cdb65 Sc53C94: improve status register. 2022-11-01 02:11:06 +01:00
Maxim Poliakovski
6ffe28a8a4 Implement SCSI Pseudo-DMA register on PDM. 2022-11-01 01:17:50 +01:00
Maxim Poliakovski
7ab44886c4 Sc53C94: implement information transfer command. 2022-11-01 01:17:50 +01:00
Maxim Poliakovski
c7ceb9d6b9 sc53c94: fix setting internal transfer counter. 2022-10-31 23:21:35 +01:00
Maxim Poliakovski
f3cd5b8b36 sc53c94: fix sending commands to SCSI devices. 2022-10-27 13:49:41 +02:00
Maxim Poliakovski
4f6bd16f3a sc53c94: support selection and command transfer. 2022-10-25 03:03:15 +02:00
Maxim Poliakovski
eeb576a927 Improve ScsiDevice class. 2022-10-25 02:53:21 +02:00
Maxim Poliakovski
2dfc160e30 sc53c94: self-registration with the device registry. 2022-07-18 20:27:34 +02:00
dingusdev
36fa53e8c1 MSVC compilation fixes 2022-03-12 15:43:45 -07:00
Maxim Poliakovski
00093bdc95 sc53c94: support interrupts. 2022-02-06 01:50:54 +01:00
Maxim Poliakovski
7c53620a40 sc53c94: implement sequencer and some commands. 2022-02-06 01:50:54 +01:00
Maxim Poliakovski
dc34f282b7 53C94: support more registers and commands. 2022-01-24 22:55:49 +01:00
Maxim Poliakovski
5883524fb8 53C94: chip initialization and identification. 2022-01-22 04:37:52 +01:00