Update 8254 Timer driver to use IoLib instead of CPU I/O Protocol
Also change the default tick rate from 54 ms to 10 ms.
git-svn-id: https://edk2.svn.sourceforge.net/svnroot/edk2/trunk/edk2@6243 6f19259b-4bc3-4df7-8a09-765794883524
diff --git a/DuetPkg/8254TimerDxe/Timer.c b/DuetPkg/8254TimerDxe/Timer.c
index c7deadd..5b5fc42 100644
--- a/DuetPkg/8254TimerDxe/Timer.c
+++ b/DuetPkg/8254TimerDxe/Timer.c
@@ -43,11 +43,6 @@
EFI_CPU_ARCH_PROTOCOL *mCpu;
//
-// Pointer to the CPU I/O Protocol instance
-//
-EFI_CPU_IO_PROTOCOL *mCpuIo;
-
-//
// Pointer to the Legacy 8259 Protocol instance
//
EFI_LEGACY_8259_PROTOCOL *mLegacy8259;
@@ -86,11 +81,9 @@
--*/
{
- UINT8 Data;
-
- Data = 0x36;
- mCpuIo->Io.Write (mCpuIo, EfiCpuIoWidthUint8, TIMER_CONTROL_PORT, 1, &Data);
- mCpuIo->Io.Write (mCpuIo, EfiCpuIoWidthFifoUint8, TIMER0_COUNT_PORT, 2, &Count);
+ IoWrite8 (TIMER_CONTROL_PORT, 0x36);
+ IoWrite8 (TIMER0_COUNT_PORT, (UINT8)(Count & 0xff));
+ IoWrite8 (TIMER0_COUNT_PORT, (UINT8)((Count >> 8) & 0xff));
}
VOID
@@ -262,6 +255,7 @@
//
mLegacy8259->DisableIrq (mLegacy8259, Efi8259Irq0);
} else {
+
//
// Convert TimerPeriod into 8254 counts
//
@@ -434,12 +428,6 @@
ASSERT_PROTOCOL_ALREADY_INSTALLED (NULL, &gEfiTimerArchProtocolGuid);
//
- // Find the CPU I/O Protocol.
- //
- Status = gBS->LocateProtocol (&gEfiCpuIoProtocolGuid, NULL, (VOID **) &mCpuIo);
- ASSERT_EFI_ERROR (Status);
-
- //
// Find the CPU architectural protocol.
//
Status = gBS->LocateProtocol (&gEfiCpuArchProtocolGuid, NULL, (VOID **) &mCpu);
@@ -481,11 +469,11 @@
//
Status = gBS->InstallMultipleProtocolInterfaces (
&mTimerHandle,
- &gEfiTimerArchProtocolGuid,
- &mTimer,
+ &gEfiTimerArchProtocolGuid, &mTimer,
NULL
);
ASSERT_EFI_ERROR (Status);
return Status;
}
+