Update CSM module to provide the general solution when the Timer Arch Protocol is not 8254 timer. CSM module should set 8254 timer to 54ms for the execution in real mode.

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


git-svn-id: https://edk2.svn.sourceforge.net/svnroot/edk2/trunk/edk2@12229 6f19259b-4bc3-4df7-8a09-765794883524
This commit is contained in:
li-elvin
2011-08-30 05:52:28 +00:00
parent bdfde4623d
commit f767f99009
4 changed files with 156 additions and 5 deletions

View File

@@ -29,6 +29,7 @@ WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
#include <Protocol/LoadedImage.h>
#include <Protocol/PciIo.h>
#include <Protocol/Cpu.h>
#include <Protocol/Timer.h>
#include <Protocol/IsaIo.h>
#include <Protocol/LegacyRegion2.h>
#include <Protocol/SimpleTextIn.h>
@@ -517,6 +518,18 @@ extern UINTN mEndOpromShadowAddress;
#define CMOS_31 0x31 ///< CMOS 0x18
#define CMOS_32 0x32 ///< Century byte
//
// 8254 Timer registers
//
#define TIMER0_COUNT_PORT 0x40
#define TIMER1_COUNT_PORT 0x41
#define TIMER2_COUNT_PORT 0x42
#define TIMER_CONTROL_PORT 0x43
//
// Timer 0, Read/Write LSB then MSB, Square wave output, binary count use.
//
#define TIMER0_CONTROL_WORD 0x36
#define LEGACY_BIOS_INSTANCE_SIGNATURE SIGNATURE_32 ('L', 'B', 'I', 'T')
typedef struct {
@@ -532,6 +545,12 @@ typedef struct {
//
EFI_CPU_ARCH_PROTOCOL *Cpu;
//
// Timer Architectural Protocol
//
EFI_TIMER_ARCH_PROTOCOL *Timer;
BOOLEAN TimerUses8254;
//
// Protocol to Lock and Unlock 0xc0000 - 0xfffff
//
@@ -543,7 +562,7 @@ typedef struct {
// Interrupt control for thunk and PCI IRQ
//
EFI_LEGACY_8259_PROTOCOL *Legacy8259;
//
// PCI Interrupt PIRQ control
//