mirror of https://github.com/xemu-project/xemu.git
mc146818rtc: Move Xbox RTC init pattern to reset handler
This commit is contained in:
parent
75ce25c9b5
commit
24c24e030d
|
@ -1006,6 +1006,20 @@ static void rtc_reset_enter(Object *obj, ResetType type)
|
|||
s->irq_coalesced = 0;
|
||||
s->irq_reinject_on_ack_count = 0;
|
||||
}
|
||||
|
||||
// xbox bios wants this bit pattern set to mark the data as valid
|
||||
#ifdef XBOX
|
||||
uint8_t bits = 0x55;
|
||||
for (int i = 0x10; i < 0x70; i++) {
|
||||
mc146818rtc_set_cmos_data(s, i, bits);
|
||||
bits = ~bits;
|
||||
}
|
||||
bits = 0x55;
|
||||
for (int i = 0x80; i < 0x100; i++) {
|
||||
mc146818rtc_set_cmos_data(s, i, bits);
|
||||
bits = ~bits;
|
||||
}
|
||||
#endif
|
||||
}
|
||||
|
||||
static void rtc_reset_hold(Object *obj, ResetType type)
|
||||
|
|
|
@ -217,8 +217,6 @@ void xbox_init_common(MachineState *machine,
|
|||
MemoryRegion *system_memory = get_system_memory();
|
||||
// MemoryRegion *system_io = get_system_io();
|
||||
|
||||
int i;
|
||||
|
||||
PCIBus *pci_bus;
|
||||
ISABus *isa_bus;
|
||||
|
||||
|
@ -298,18 +296,6 @@ void xbox_init_common(MachineState *machine,
|
|||
// idebus[0] = qdev_get_child_bus(&dev->qdev, "ide.0");
|
||||
// idebus[1] = qdev_get_child_bus(&dev->qdev, "ide.1");
|
||||
|
||||
// xbox bios wants this bit pattern set to mark the data as valid
|
||||
uint8_t bits = 0x55;
|
||||
for (i = 0x10; i < 0x70; i++) {
|
||||
mc146818rtc_set_cmos_data(rtc_state, i, bits);
|
||||
bits = ~bits;
|
||||
}
|
||||
bits = 0x55;
|
||||
for (i = 0x80; i < 0x100; i++) {
|
||||
mc146818rtc_set_cmos_data(rtc_state, i, bits);
|
||||
bits = ~bits;
|
||||
}
|
||||
|
||||
/* smbus devices */
|
||||
smbus_xbox_smc_init(smbus, 0x10);
|
||||
|
||||
|
|
Loading…
Reference in New Issue