stos/amd64: hpet: Enable the main counter
Signed-off-by: Chloe M. <chloe@mensia.org>
This commit is contained in:
@@ -36,7 +36,7 @@ HpetWriteq(UCHAR Register, UQUAD Value)
|
||||
}
|
||||
|
||||
RegBase = PTR_OFFSET(MMIOBase, Register);
|
||||
MMIOWrite64(MMIOBase, Value);
|
||||
MMIOWrite64(RegBase, Value);
|
||||
}
|
||||
|
||||
/*
|
||||
@@ -61,7 +61,7 @@ VOID
|
||||
MdHpetInit(VOID)
|
||||
{
|
||||
ACPI_HPET *Hpet;
|
||||
UQUAD GeneralCap;
|
||||
UQUAD GeneralCap, GeneralConf;
|
||||
ULONG ClkPeriod;
|
||||
UCHAR RevId;
|
||||
const ACPI_GAS *Gas;
|
||||
@@ -96,4 +96,11 @@ MdHpetInit(VOID)
|
||||
KeKnot(KNOT_MISC, "hpet: bad counter clk period\n");
|
||||
if (RevId == 0)
|
||||
KeKnot(KNOT_MISC, "hpet: bad revision id, must not be zero\n");
|
||||
|
||||
HpetWriteq(HPET_MAIN_COUNTER, 0);
|
||||
|
||||
/* Enable the counter */
|
||||
GeneralConf = HpetReadq(HPET_GENERAL_CONF);
|
||||
GeneralConf |= HPET_GCONF_EN;
|
||||
HpetWriteq(HPET_GENERAL_CONF, GeneralConf);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user