Commit Graph

303 Commits

Author SHA1 Message Date
joevt
1f9f2d2cf1 sixty6: Add support for sixty6 video output. 2024-03-14 20:06:55 -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
c14974d167 sc53c94: Init class fields. 2024-03-13 21:37:08 -07:00
joevt
f07de5401d sc53c94: Add registers and comments. 2024-03-13 21:25:28 -07:00
dingusdev
faf066f2b9 Fixed building 2024-03-13 21:17:04 -07:00
joevt
06640844e9 scsihd: Allow read and write > 4 GB. 2024-03-13 21:09:55 -07:00
joevt
bfc703a556 scsihd: Add sector_size.
Replace HDD_SECTOR_SIZE with class field sector_size.
2024-03-13 21:06:18 -07:00
joevt
ec01993d84 scsihd: Make seek and rewind illegal. 2024-03-13 18:42:25 -07:00
joevt
5a54b6a761 scsicdrom: Rename read_capacity_10.
Like scsihd.
2024-03-13 07:50:32 -07:00
joevt
a605c435b6 scsicdrom: Move test_unit_ready.
Make it a separate method like scsihd.
2024-03-13 07:50:20 -07:00
joevt
05da1708eb scsihd: Remove unused cur_buf_cnt. 2024-03-13 07:46:12 -07:00
joevt
3f826b8971 scsi: Add illegal_command method.
- scsicdrom now logs unsupported commands instead of abort.
2024-03-13 07:45:50 -07:00
joevt
de8388f9a7 scsihd: Rename img_buffer to data_buf.
To match scsicdrom.
2024-03-13 07:44:52 -07:00
joevt
569f782a60 scsihd: Rename hdd_img to disk_img. 2024-03-13 07:44:43 -07:00
dingusdev
96b9b6a375 Fixed building 2024-03-12 21:30:38 -07:00
joevt
091cf4337c scsidevice: Remember SELECT_WITH_ATN message.
It might be an IDENTIFY message which contains a LUN number.
2024-03-12 08:01:52 -07:00
joevt
ff9b8a59e2 scsibus: Change control lines for MESSAGE_IN. 2024-03-12 07:49:43 -07:00
joevt
1fb9e37ec5 scsidevice: Add check_lun.
This will create a CHECK_CONDITON if the LUN doesn't match.
2024-03-11 20:24:24 -07:00
dingusdev
b63e42ecf2 Temporarily removing SOFT RESET ATA command
Not implemented properly. Will re-implement soon.
2024-03-11 19:05:13 -07:00
joevt
2ece059c5e atapi: Add ATAPI_SOFT_RESET command.
I don't know if this is correct.
2024-03-11 07:19:11 -07:00
leap123
c1b557fbb9
Fix build on Fedora 2024-03-11 13:01:43 +07:00
joevt
a11770961e Add pci_find_device for pci type 0 requests. 2024-03-09 17:49:51 -07:00
joevt
2d8f2422b3 dbmda: Fix dma output res_count update.
Use this->res_count to track amount of data transferred.
2024-03-09 06:47:48 -07:00
joevt
0166059d1b dbdma: Add set_stat method.
A hardware device may have status flags connected to 8 status bits of the DBDMA engine.
2024-03-09 06:45:06 -07:00
joevt
29d13aef09 dma: Add is_active method for input channels.
Since DBDMA contains an input and output channel, rename the existing is_active method to is_out_active.
2024-03-09 06:20:13 -07:00
Mihai Parparita
57e6e90002 Add support for the CUDA_RESTART_SYSTEM command
There are cases where when it's necessary (e.g. given uninitialized NVRAM,
the Beige G3 with the 10.2 install CD inserted will update the boot
device and restart to boot from it).

Restart support was done by wrapping the ppc_exec function in a loop and
checking for a restart power off reason. We also need to disconnect all
event listeners, since they will be recreated when the machine is
re-initialized.
2024-03-07 23:32:23 -08:00
Mihai Parparita
10af336cd1 Ensure that VIA timers are stopped when the object is destroyed. 2024-03-07 23:31:56 -08:00
joevt
777a02cbe9 pci: Use SIZE_ARG for logging arg size.
The SIZE_ARG macro defined in pcibase can be used outside pcibase with a small modification.
2024-03-04 21:16:46 -07:00
joevt
61b1940397 pci: Add command register mask.
The mask represents the list of bits that are allowed to change in the command register of PCI config space.
2024-03-04 21:16:38 -07:00
joevt
fb0396923f Fix dma STORE_QUAD and LOAD_QUAD.
When fetching DMA command, make sure to convert little endian fields to host endianness (i.e. don't use memcpy).
When fetching DMA command, return the host address of the DMA command for LOAD_QUAD. Maybe this address should be cached whenever this->cmdptr changes?
When fetching DMA command, return whether the DMA command is writable.
For LOAD_QUAD, pass the address of the DMA command to xfer_quad.
Always log unexpected DMA command values.
Write full 32-bit value for LOAD_QUAD.
Write reqCount to resCount.
2024-03-04 20:38:07 -07:00
joevt
6503a300cc Add PCI interrupt method.
A PCI device passes an interrupt to its host. The host will determine from the PCI device which interrupt to trigger.
2024-03-04 07:47:20 -07:00
joevt
be80595834 Remove obsolete pci config type 1 methods.
pci_find_device is the method used to pass pci config type 1 methods to child PCI devices.
2024-03-04 07:47:08 -07:00
joevt
54bda0ea95 pci: Change pci_conv_rd_data unaligned.
pci_conv_rd_data can be used to handle unaligned or 64-bit accesses in mmio regions if it's modified to include the next 32-bit value.
For pci config accesses, grackle repeats the 32-bit value. bandit uses a seemingly random number for the next 32-bit value, but we'll make it work like grackle.
2024-03-03 20:06:13 -07:00
joevt
6d23e18c11 pci: Add PCI CardBus bridge.
PCCard is used by PowerBook G3 Wallstreet in Open Firmware 2.0.1.
CardBus is probed in New World Macs starting from at least Open Firmware 4.1.9f1 sometime after Open Firmware 3.1.1.

- Create PCIBase from common stuff in PCIDevice.
- Add PCIBridgeBase. These have a primary bus number, secondary bus number, and subordinate bus number which are used to determine if PCI type 1 config cycle should be passed.
- Change PCIBridge to use PCIBridgeBase instead of PCIDevice.
- Add PCICardBusBridge which uses PCIBridgeBase.
2024-03-03 16:00:55 -07:00
joevt
5f8e7fcb73 pci: Log invalid BAR values.
For example, Old World Macs have versions of Open Firmware that don't support 512 MB BARs correctly. They may attempt to set such a BAR to 0x90000000 (a 256 MB boundary) instead of 0xA0000000 (the next available 512 MB boundary).
2024-03-03 15:49:59 -07:00
joevt
d426d0faeb Add settings when adding pci device. 2024-03-03 15:01:39 -07:00
joevt
1e78512c95 Rename Curio and Mesh. 2024-03-02 11:12:45 -07:00
joevt
ad8a26616f scsidevice: Add LUN field.
This may make it possible for multiple LUNs to be added to the same target ID.
For now just use LUN #0.
2024-03-02 08:52:09 -07:00
joevt
8f28823217 scsi: Initialize cur_phase. 2024-03-02 08:51:45 -07:00
joevt
5876cc7e17 bandit: Fix indent. 2024-03-02 08:09:42 -07:00
joevt
2998796c2c pci: Fix log message for PCI rom exceptions.
It should log device name, not just "PCIDevice".
2024-03-01 08:02:01 -07:00
joevt
84a694d4c2 nvram: Output nvram file name in error message.
So that you don't see identical messages "Could not restore NVRAM content from the given file."
Instead, one will mention nvram.bin and the other will mention pram.bin.
2024-03-01 07:59:19 -07:00
joevt
fe05b1de12 Fix compiler warnings.
Xcode build has compiler warnings involving loss of precision. Remove them by adding type casts. Check results in some cases for overflow.
2024-02-29 18:49:14 -07:00
joevt
8baf722343 Spelling. 2024-02-20 01:53:32 +01:00
joevt
b0dc893a05 dma: Add name to dma classes.
For logging purposes, each DMA channel should have a name.
2024-02-19 15:30:20 +01:00
Maxim Poliakovski
f5bb484226 sc53c94: fix interrupt reporting. 2024-02-19 15:30:20 +01:00
Maxim Poliakovski
28e7a806b4 grandcentral: use MeshStub on machines without MESH. 2024-02-12 02:38:38 +01:00
Maxim Poliakovski
046452fc56 mesh: various improvements. 2024-02-12 02:17:09 +01:00
Maxim Poliakovski
061fc5a24d hwinterrupt: remove deprecated SCSI0 & SCSI1. 2024-02-12 01:46:21 +01:00