Gossamer: factory test control.

This commit is contained in:
Maxim Poliakovski 2022-07-20 20:08:37 +02:00
parent f0553720d6
commit c3939e3b25
3 changed files with 23 additions and 7 deletions

View File

@ -83,6 +83,9 @@ HeathrowIC::HeathrowIC() : PCIDevice("mac-io/heathrow"), InterruptCtrl()
// connect floppy disk HW
this->swim3 = dynamic_cast<Swim3::Swim3Ctrl*>(gMachineObj->get_comp_by_name("Swim3"));
// set EMMO pin status (active low)
this->emmo_pin = GET_BIN_PROP("emmo") ^ 1;
}
void HeathrowIC::notify_bar_change(int bar_num)
@ -234,11 +237,12 @@ uint32_t HeathrowIC::mio_ctrl_read(uint32_t offset, int size) {
case MIO_INT_LEVELS1:
res = this->int_levels1;
break;
case 0x34: /* heathrowIDs / HEATHROW_MBCR (Linux): media bay config reg? */
case MIO_HEAT_ID:
LOG_F(9, "read from MIO:ID register at Address %x \n", ppc_state.pc);
res = this->macio_id;
res = (this->fp_id << 24) | (this->mon_id << 16) | (this->mb_id << 8) |
(this->cpu_id | this->emmo_pin);
break;
case 0x38:
case MIO_HEAT_FEAT_CTRL:
LOG_F(9, "read from MIO:Feat_Ctrl register \n");
res = this->feat_ctrl;
break;
@ -274,10 +278,10 @@ void HeathrowIC::mio_ctrl_write(uint32_t offset, uint32_t value, int size) {
this->int_events1 &= BYTESWAP_32(value);
}
break;
case 0x34:
case MIO_HEAT_ID:
LOG_F(WARNING, "Attempted to write %x to MIO:ID at %x; Address : %x \n", value, offset, ppc_state.pc);
break;
case 0x38:
case MIO_HEAT_FEAT_CTRL:
this->feature_control(BYTESWAP_32(value));
break;
case 0x3C:

View File

@ -155,6 +155,12 @@ private:
VIA-CUDA register space: 0x00016000, size: 0x00002000
*/
/** Heathrow specific registers. */
enum {
MIO_HEAT_ID = 0x34, // IDs register
MIO_HEAT_FEAT_CTRL = 0x38, // feature control register
};
class HeathrowIC : public PCIDevice, public InterruptCtrl {
public:
HeathrowIC();
@ -193,13 +199,17 @@ private:
uint32_t int_events1 = 0;
uint32_t int_mask1 = 0;
uint32_t int_levels1 = 0;
uint32_t macio_id = 0xF0700008UL;
uint32_t feat_ctrl = 0; // features control register
uint32_t aux_ctrl = 0; // aux features control register
uint8_t cpu_id = 0xE0; // CPUID field (LSB of the MIO_HEAT_ID)
uint8_t mb_id = 0x70; // Media Bay ID (bits 15:8 of the MIO_HEAT_ID)
uint8_t mon_id = 0x10; // Monitor ID (bits 23:16 of the MIO_HEAT_ID)
uint8_t fp_id = 0x70; // Flat panel ID (MSB of the MIO_HEAT_ID)
uint8_t emmo_pin; // factory tester status, active low
// subdevice objects
std::unique_ptr<AwacsScreamer> screamer; // Screamer audio codec instance
//std::unique_ptr<MESHController> mesh; // MESH SCSI cell instance
NVram* nvram; // NVRAM
ViaCuda* viacuda; // VIA cell with Cuda MCU attached to it

View File

@ -102,6 +102,8 @@ static const PropMap gossamer_settings = {
new IntProperty( 0, vector<uint32_t>({0, 8, 16, 32, 64, 128, 256}))},
{"rambank3_size",
new IntProperty( 0, vector<uint32_t>({0, 8, 16, 32, 64, 128, 256}))},
{"emmo",
new BinProperty(0)},
};
static vector<string> pmg3_devices = {