Add generic HPET Timer DXE Driver and support libraries.

Minor update to logic to prevent writing a the read-only MSI Capability bit with 0 when HPET supports MSIs

Signed-off-by: mdkinney
Reviewed-by: li-elvin

git-svn-id: https://edk2.svn.sourceforge.net/svnroot/edk2/trunk/edk2@12272 6f19259b-4bc3-4df7-8a09-765794883524
This commit is contained in:
mdkinney 2011-09-02 15:30:54 +00:00
parent 5025be3fc1
commit 0cdda8d6f0
1 changed files with 3 additions and 4 deletions

View File

@ -440,7 +440,7 @@ TimerDriverSetTimerPeriod (
// If TimerPeriod is 0, then mask HPET Timer interrupts // If TimerPeriod is 0, then mask HPET Timer interrupts
// //
if (mTimerConfiguration.Bits.MsiInterruptCapablity != 0) { if (mTimerConfiguration.Bits.MsiInterruptCapablity != 0 && FeaturePcdGet (PcdHpetMsiEnable)) {
// //
// Disable HPET MSI interrupt generation // Disable HPET MSI interrupt generation
// //
@ -498,7 +498,7 @@ TimerDriverSetTimerPeriod (
// //
// Enable HPET Timer interrupt generation // Enable HPET Timer interrupt generation
// //
if (mTimerConfiguration.Bits.MsiInterruptCapablity != 0) { if (mTimerConfiguration.Bits.MsiInterruptCapablity != 0 && FeaturePcdGet (PcdHpetMsiEnable)) {
// //
// Enable HPET MSI Interrupt // Enable HPET MSI Interrupt
// //
@ -789,7 +789,6 @@ TimerDriverInitialize (
// Set InterruptRoute field based in mTimerIrq // Set InterruptRoute field based in mTimerIrq
// //
mTimerConfiguration.Uint64 = HpetRead (HPET_TIMER_CONFIGURATION_OFFSET + mTimerIndex * HPET_TIMER_STRIDE); mTimerConfiguration.Uint64 = HpetRead (HPET_TIMER_CONFIGURATION_OFFSET + mTimerIndex * HPET_TIMER_STRIDE);
mTimerConfiguration.Bits.MsiInterruptCapablity = 0;
mTimerConfiguration.Bits.LevelTriggeredInterrupt = 1; mTimerConfiguration.Bits.LevelTriggeredInterrupt = 1;
mTimerConfiguration.Bits.InterruptRoute = mTimerIrq; mTimerConfiguration.Bits.InterruptRoute = mTimerIrq;
} }
@ -829,7 +828,7 @@ TimerDriverInitialize (
// Show state of enabled HPET timer // Show state of enabled HPET timer
// //
DEBUG_CODE ( DEBUG_CODE (
if (mTimerConfiguration.Bits.MsiInterruptCapablity != 0) { if (mTimerConfiguration.Bits.MsiInterruptCapablity != 0 && FeaturePcdGet (PcdHpetMsiEnable)) {
DEBUG ((DEBUG_INFO, "HPET Interrupt Mode MSI\n")); DEBUG ((DEBUG_INFO, "HPET Interrupt Mode MSI\n"));
} else { } else {
DEBUG ((DEBUG_INFO, "HPET Interrupt Mode I/O APIC\n")); DEBUG ((DEBUG_INFO, "HPET Interrupt Mode I/O APIC\n"));