mirror of https://github.com/xqemu/xqemu.git
[Core Change] Fix PM timer at 3.375 MHz for Xbox compat
This commit is contained in:
parent
70de2f76b0
commit
68b54a7cc9
|
@ -502,13 +502,21 @@ static inline int64_t acpi_pm_tmr_get_clock(void)
|
||||||
void acpi_pm_tmr_calc_overflow_time(ACPIREGS *ar)
|
void acpi_pm_tmr_calc_overflow_time(ACPIREGS *ar)
|
||||||
{
|
{
|
||||||
int64_t d = acpi_pm_tmr_get_clock();
|
int64_t d = acpi_pm_tmr_get_clock();
|
||||||
|
#ifdef XBOX
|
||||||
|
ar->tmr.overflow_time = (d + 0x80000000LL) & ~0x7fffffffLL;
|
||||||
|
#else
|
||||||
ar->tmr.overflow_time = (d + 0x800000LL) & ~0x7fffffLL;
|
ar->tmr.overflow_time = (d + 0x800000LL) & ~0x7fffffLL;
|
||||||
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
static uint32_t acpi_pm_tmr_get(ACPIREGS *ar)
|
static uint32_t acpi_pm_tmr_get(ACPIREGS *ar)
|
||||||
{
|
{
|
||||||
uint32_t d = acpi_pm_tmr_get_clock();
|
uint32_t d = acpi_pm_tmr_get_clock();
|
||||||
|
#ifdef XBOX
|
||||||
|
return d;
|
||||||
|
#else
|
||||||
return d & 0xffffff;
|
return d & 0xffffff;
|
||||||
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
static void acpi_pm_tmr_timer(void *opaque)
|
static void acpi_pm_tmr_timer(void *opaque)
|
||||||
|
|
|
@ -130,6 +130,9 @@ static void init_common_fadt_data(Object *o, AcpiFadtData *data)
|
||||||
(1 << ACPI_FADT_F_SLP_BUTTON) |
|
(1 << ACPI_FADT_F_SLP_BUTTON) |
|
||||||
(1 << ACPI_FADT_F_RTC_S4) |
|
(1 << ACPI_FADT_F_RTC_S4) |
|
||||||
(1 << ACPI_FADT_F_USE_PLATFORM_CLOCK) |
|
(1 << ACPI_FADT_F_USE_PLATFORM_CLOCK) |
|
||||||
|
#ifdef XBOX
|
||||||
|
(1 << ACPI_FADT_F_TMR_VAL_EXT) |
|
||||||
|
#endif
|
||||||
/* APIC destination mode ("Flat Logical") has an upper limit of 8
|
/* APIC destination mode ("Flat Logical") has an upper limit of 8
|
||||||
* CPUs for more than 8 CPUs, "Clustered Logical" mode has to be
|
* CPUs for more than 8 CPUs, "Clustered Logical" mode has to be
|
||||||
* used
|
* used
|
||||||
|
|
|
@ -50,7 +50,11 @@
|
||||||
#define ACPI_PM_PROP_GPE0_BLK_LEN "gpe0_blk_len"
|
#define ACPI_PM_PROP_GPE0_BLK_LEN "gpe0_blk_len"
|
||||||
|
|
||||||
/* PM Timer ticks per second (HZ) */
|
/* PM Timer ticks per second (HZ) */
|
||||||
|
#ifdef XBOX
|
||||||
|
#define PM_TIMER_FREQUENCY 3375000
|
||||||
|
#else
|
||||||
#define PM_TIMER_FREQUENCY 3579545
|
#define PM_TIMER_FREQUENCY 3579545
|
||||||
|
#endif
|
||||||
|
|
||||||
|
|
||||||
/* ACPI fixed hardware registers */
|
/* ACPI fixed hardware registers */
|
||||||
|
|
Loading…
Reference in New Issue