summaryrefslogtreecommitdiff
path: root/DuetPkg
diff options
context:
space:
mode:
authormdkinney <mdkinney@6f19259b-4bc3-4df7-8a09-765794883524>2008-10-27 02:11:49 +0000
committermdkinney <mdkinney@6f19259b-4bc3-4df7-8a09-765794883524>2008-10-27 02:11:49 +0000
commit0f25cc149a40eefdb91786a018a38056453e702b (patch)
tree66d2c40dd22458e2bfbb347f41fefec11f24beaf /DuetPkg
parent03c110536d88185e1fb37a56d194f254042f0dfd (diff)
downloadedk2-platforms-0f25cc149a40eefdb91786a018a38056453e702b.tar.xz
Update Metronome driver to use the IoLib instead of the CPU I/O Protocol.
git-svn-id: https://edk2.svn.sourceforge.net/svnroot/edk2/trunk/edk2@6242 6f19259b-4bc3-4df7-8a09-765794883524
Diffstat (limited to 'DuetPkg')
-rw-r--r--DuetPkg/LegacyMetronome/Metronome.c80
-rw-r--r--DuetPkg/LegacyMetronome/Metronome.h2
2 files changed, 3 insertions, 79 deletions
diff --git a/DuetPkg/LegacyMetronome/Metronome.c b/DuetPkg/LegacyMetronome/Metronome.c
index acc0dad45c..2307529e2a 100644
--- a/DuetPkg/LegacyMetronome/Metronome.c
+++ b/DuetPkg/LegacyMetronome/Metronome.c
@@ -34,74 +34,8 @@ EFI_METRONOME_ARCH_PROTOCOL mMetronome = {
};
//
-// The CPU I/O Protocol used to access system hardware
-//
-EFI_CPU_IO_PROTOCOL *mCpuIo = NULL;
-
-//
// Worker Functions
//
-VOID
-IoWrite8 (
- UINT16 Port,
- UINT8 Data
- )
-/*++
-
-Routine Description:
-
- Write an 8 bit value to an I/O port and save it to the S3 script
-
-Arguments:
-
-Returns:
-
- None.
-
---*/
-// TODO: Port - add argument and description to function comment
-// TODO: Data - add argument and description to function comment
-{
- mCpuIo->Io.Write (
- mCpuIo,
- EfiCpuIoWidthUint8,
- Port,
- 1,
- &Data
- );
-
-}
-
-UINT8
-ReadRefresh (
- VOID
- )
-/*++
-
-Routine Description:
-
- Read the refresh bit from the REFRESH_PORT
-
-Arguments:
-
-Returns:
-
- None.
-
---*/
-{
- UINT8 Data;
-
- mCpuIo->Io.Read (
- mCpuIo,
- EfiCpuIoWidthUint8,
- REFRESH_PORT,
- 1,
- &Data
- );
- return (UINT8) (Data & REFRESH_ON);
-}
-
EFI_STATUS
EFIAPI
WaitForTick (
@@ -130,10 +64,8 @@ Returns:
// Wait for TickNumber toggles of the Refresh bit
//
for (; TickNumber != 0x00; TickNumber--) {
- while (ReadRefresh () == REFRESH_ON)
- ;
- while (ReadRefresh () == REFRESH_OFF)
- ;
+ while ((IoRead8(REFRESH_PORT) & REFRESH_ON) == REFRESH_ON);
+ while ((IoRead8(REFRESH_PORT) & REFRESH_ON) == REFRESH_OFF);
}
return EFI_SUCCESS;
@@ -172,14 +104,6 @@ Returns:
ASSERT_PROTOCOL_ALREADY_INSTALLED (NULL, &gEfiMetronomeArchProtocolGuid);
//
- // Get the CPU I/O Protocol that this driver requires
- // If the CPU I/O Protocol is not found, then ASSERT because the dependency expression
- // should guarantee that it is present in the handle database.
- //
- Status = gBS->LocateProtocol (&gEfiCpuIoProtocolGuid, NULL, &mCpuIo);
- ASSERT_EFI_ERROR (Status);
-
- //
// Program port 61 timer 1 as refresh timer. We could use ACPI timer in the
// future.
//
diff --git a/DuetPkg/LegacyMetronome/Metronome.h b/DuetPkg/LegacyMetronome/Metronome.h
index 87a12cbc34..df8d58d05c 100644
--- a/DuetPkg/LegacyMetronome/Metronome.h
+++ b/DuetPkg/LegacyMetronome/Metronome.h
@@ -27,11 +27,11 @@ Abstract:
//
#include <PiDxe.h>
-#include <Protocol/CpuIo.h>
#include <Protocol/Metronome.h>
#include <Library/DebugLib.h>
#include <Library/UefiBootServicesTableLib.h>
+#include <Library/IoLib.h>
//
// Private definitions