mirror of
https://github.com/dingusdev/dingusppc.git
synced 2024-06-25 23:29:33 +00:00
machinepdm: support for pluggable PDS devices.
This commit is contained in:
parent
ee9448cbc6
commit
e33b141b7e
|
@ -84,6 +84,7 @@ static const map<string, string> PropHelp = {
|
||||||
{"pci_C1", "insert a PCI device into C1 slot"},
|
{"pci_C1", "insert a PCI device into C1 slot"},
|
||||||
{"serial_backend", "specifies the backend for the serial port"},
|
{"serial_backend", "specifies the backend for the serial port"},
|
||||||
{"emmo", "enables/disables factory HW tests during startup"},
|
{"emmo", "enables/disables factory HW tests during startup"},
|
||||||
|
{"pds", "specify device for the processsor direct slot"},
|
||||||
};
|
};
|
||||||
|
|
||||||
bool MachineFactory::add(const string& machine_id, MachineDescription desc)
|
bool MachineFactory::add(const string& machine_id, MachineDescription desc)
|
||||||
|
|
|
@ -36,6 +36,35 @@ along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||||
#include <string>
|
#include <string>
|
||||||
#include <vector>
|
#include <vector>
|
||||||
|
|
||||||
|
void setup_pds()
|
||||||
|
{
|
||||||
|
std::string dev_name = GET_STR_PROP("pds");
|
||||||
|
if (!dev_name.empty()) {
|
||||||
|
if (!DeviceRegistry::device_registered(dev_name)) {
|
||||||
|
LOG_F(WARNING, "specified PDS device %s doesn't exist", dev_name.c_str());
|
||||||
|
goto empty_slot;
|
||||||
|
}
|
||||||
|
|
||||||
|
// attempt to create device object
|
||||||
|
auto dev_obj = DeviceRegistry::get_descriptor(dev_name).m_create_func();
|
||||||
|
|
||||||
|
// safety check
|
||||||
|
if (!dev_obj->supports_type(HWCompType::PDS_DEV)) {
|
||||||
|
LOG_F(WARNING, "Cannot use device %s with the PDS", dev_name.c_str());
|
||||||
|
goto empty_slot;
|
||||||
|
}
|
||||||
|
|
||||||
|
// add device to the machine object
|
||||||
|
gMachineObj->add_device(dev_name, std::move(dev_obj));
|
||||||
|
|
||||||
|
LOG_F(INFO, "PDS slot: %s", dev_name.c_str());
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
empty_slot:
|
||||||
|
LOG_F(INFO, "PDS slot: empty");
|
||||||
|
}
|
||||||
|
|
||||||
int initialize_pdm(std::string& id)
|
int initialize_pdm(std::string& id)
|
||||||
{
|
{
|
||||||
uint16_t machine_id;
|
uint16_t machine_id;
|
||||||
|
@ -81,6 +110,9 @@ int initialize_pdm(std::string& id)
|
||||||
// add internal SCSI bus
|
// add internal SCSI bus
|
||||||
gMachineObj->add_device("SCSI0", std::unique_ptr<ScsiBus>(new ScsiBus()));
|
gMachineObj->add_device("SCSI0", std::unique_ptr<ScsiBus>(new ScsiBus()));
|
||||||
|
|
||||||
|
// set up the processor direct slot
|
||||||
|
setup_pds();
|
||||||
|
|
||||||
// Init virtual CPU and request MPC601
|
// Init virtual CPU and request MPC601
|
||||||
ppc_cpu_init(hmc_obj, PPC_VER::MPC601, 7812500ULL);
|
ppc_cpu_init(hmc_obj, PPC_VER::MPC601, 7812500ULL);
|
||||||
|
|
||||||
|
@ -102,6 +134,8 @@ static const PropMap pm6100_settings = {
|
||||||
new IntProperty(0, vector<uint32_t>({0, 8, 16, 32, 64, 128}))},
|
new IntProperty(0, vector<uint32_t>({0, 8, 16, 32, 64, 128}))},
|
||||||
{"mon_id",
|
{"mon_id",
|
||||||
new StrProperty("HiRes12-14in", PDMBuiltinMonitorIDs)},
|
new StrProperty("HiRes12-14in", PDMBuiltinMonitorIDs)},
|
||||||
|
{"pds",
|
||||||
|
new StrProperty("")},
|
||||||
{"emmo",
|
{"emmo",
|
||||||
new BinProperty(0)},
|
new BinProperty(0)},
|
||||||
};
|
};
|
||||||
|
|
Loading…
Reference in New Issue
Block a user