mirror of https://github.com/acidanthera/audk.git
DebugAgentTimerLib cleanup
git-svn-id: https://edk2.svn.sourceforge.net/svnroot/edk2/trunk/edk2@10372 6f19259b-4bc3-4df7-8a09-765794883524
This commit is contained in:
parent
2db3d8672c
commit
9e4f210c32
|
@ -77,19 +77,27 @@ DebugAgentTimerIntialize (
|
||||||
)
|
)
|
||||||
{
|
{
|
||||||
UINT32 TimerBaseAddress;
|
UINT32 TimerBaseAddress;
|
||||||
|
UINT32 TimerNumber;
|
||||||
|
|
||||||
|
TimerNumber = PcdGet32(PcdOmap35xxDebugAgentTimer);
|
||||||
gVector = InterruptVectorForTimer (PcdGet32(PcdOmap35xxDebugAgentTimer));
|
gVector = InterruptVectorForTimer (TimerNumber);
|
||||||
|
|
||||||
// Set up the timer registers
|
// Set up the timer registers
|
||||||
TimerBaseAddress = TimerBase (PcdGet32(PcdOmap35xxDebugAgentTimer));
|
TimerBaseAddress = TimerBase (TimerNumber);
|
||||||
gTISR = TimerBaseAddress + GPTIMER_TISR;
|
gTISR = TimerBaseAddress + GPTIMER_TISR;
|
||||||
gTCLR = TimerBaseAddress + GPTIMER_TCLR;
|
gTCLR = TimerBaseAddress + GPTIMER_TCLR;
|
||||||
gTLDR = TimerBaseAddress + GPTIMER_TLDR;
|
gTLDR = TimerBaseAddress + GPTIMER_TLDR;
|
||||||
gTCRR = TimerBaseAddress + GPTIMER_TCRR;
|
gTCRR = TimerBaseAddress + GPTIMER_TCRR;
|
||||||
gTIER = TimerBaseAddress + GPTIMER_TIER;
|
gTIER = TimerBaseAddress + GPTIMER_TIER;
|
||||||
|
|
||||||
DisableInterruptSource ();
|
if ((TimerNumber < 2) || (TimerNumber > 9)) {
|
||||||
|
// This code assumes one the General Purpose timers is used
|
||||||
|
// GPT2 - GPT9
|
||||||
|
CpuDeadLoop ();
|
||||||
|
}
|
||||||
|
// Set source clock for GPT2 - GPT9 to SYS_CLK
|
||||||
|
MmioOr32 (CM_CLKSEL_PER, 1 << (TimerNumber - 2));
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@ -154,5 +162,5 @@ DebugAgentTimerEndOfInterrupt (
|
||||||
ArmDataSyncronizationBarrier ();
|
ArmDataSyncronizationBarrier ();
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -44,5 +44,5 @@
|
||||||
gOmap35xxTokenSpaceGuid.PcdOmap35xxArchTimer|3|UINT32|0x00000205
|
gOmap35xxTokenSpaceGuid.PcdOmap35xxArchTimer|3|UINT32|0x00000205
|
||||||
gOmap35xxTokenSpaceGuid.PcdOmap35xxFreeTimer|4|UINT32|0x00000206
|
gOmap35xxTokenSpaceGuid.PcdOmap35xxFreeTimer|4|UINT32|0x00000206
|
||||||
gOmap35xxTokenSpaceGuid.PcdOmap35xxDebugAgentTimer|5|UINT32|0x00000207
|
gOmap35xxTokenSpaceGuid.PcdOmap35xxDebugAgentTimer|5|UINT32|0x00000207
|
||||||
gOmap35xxTokenSpaceGuid.PcdDebugAgentTimerFreqNanoSeconds|1|UINT32|0x00000208
|
gOmap35xxTokenSpaceGuid.PcdDebugAgentTimerFreqNanoSeconds|77|UINT32|0x00000208
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue