GrandCentral: external SCSI (Curio style).

This commit is contained in:
Maxim Poliakovski 2022-03-27 12:58:48 +02:00
parent b47de8b042
commit 0ab4f4a7f9
2 changed files with 11 additions and 1 deletions

View File

@ -19,6 +19,7 @@ You should have received a copy of the GNU General Public License
along with this program. If not, see <https://www.gnu.org/licenses/>.
*/
#include <devices/common/scsi/sc53c94.h>
#include <devices/ethernet/mace.h>
#include <devices/ioctrl/macio.h>
#include <devices/serial/escc.h>
@ -60,6 +61,8 @@ GrandCentral::GrandCentral() : PCIDevice("mac-io/grandcentral"), InterruptCtrl()
);
this->escc = std::unique_ptr<EsccController> (new EsccController());
this->scsi_0 = std::unique_ptr<Sc53C94> (new Sc53C94());
}
void GrandCentral::notify_bar_change(int bar_num)
@ -83,6 +86,8 @@ uint32_t GrandCentral::read(uint32_t reg_start, uint32_t offset, int size)
unsigned subdev_num = (offset >> 12) & 0xF;
switch (subdev_num) {
case 0: // Curio SCSI
return this->scsi_0->read((offset >> 4) & 0xF);
case 1: // MACE
return this->mace->read((offset >> 4) & 0x1F);
case 2: // ESCC compatible addressing
@ -128,6 +133,9 @@ void GrandCentral::write(uint32_t reg_start, uint32_t offset, uint32_t value, in
unsigned subdev_num = (offset >> 12) & 0xF;
switch (subdev_num) {
case 0: // Curio SCSI
this->scsi_0->write((offset >> 4) & 0xF, value);
break;
case 1: // MACE registers
this->mace->write((offset >> 4) & 0x1F, value);
break;

View File

@ -57,6 +57,7 @@ along with this program. If not, see <https://www.gnu.org/licenses/>.
#include <devices/common/pci/pcidevice.h>
#include <devices/common/pci/pcihost.h>
#include <devices/common/scsi/mesh.h>
#include <devices/common/scsi/sc53c94.h>
#include <devices/common/viacuda.h>
#include <devices/ethernet/mace.h>
#include <devices/floppy/swim3.h>
@ -112,7 +113,8 @@ private:
std::unique_ptr<AwacsScreamer> awacs; // AWACS audio codec instance
std::unique_ptr<ViaCuda> viacuda; // VIA cell with Cuda MCU attached to it
std::unique_ptr<NVram> nvram; // NVRAM module
std::unique_ptr<EsccController> escc; // ESCC serial controller
std::unique_ptr<EsccController> escc; // ESCC serial controller
std::unique_ptr<Sc53C94> scsi_0; // external SCSI
std::unique_ptr<DMAChannel> snd_out_dma;
};