summaryrefslogtreecommitdiff
path: root/Omap35xxPkg/Library
diff options
context:
space:
mode:
authorandrewfish <andrewfish@6f19259b-4bc3-4df7-8a09-765794883524>2010-04-14 18:05:19 +0000
committerandrewfish <andrewfish@6f19259b-4bc3-4df7-8a09-765794883524>2010-04-14 18:05:19 +0000
commit9e4f210c32dd8ad4484cedbe9a09c5b44e4f2e3c (patch)
tree198a4a8e7b74ee7cdd8d96f256293028f1f8d5fd /Omap35xxPkg/Library
parent2db3d8672c0d8048ade24b822eafceed6aaef3ab (diff)
DebugAgentTimerLib cleanup
git-svn-id: https://edk2.svn.sourceforge.net/svnroot/edk2/trunk/edk2@10372 6f19259b-4bc3-4df7-8a09-765794883524
Diffstat (limited to 'Omap35xxPkg/Library')
-rwxr-xr-xOmap35xxPkg/Library/DebugAgentTimerLib/DebugAgentTimerLib.c18
1 files changed, 13 insertions, 5 deletions
diff --git a/Omap35xxPkg/Library/DebugAgentTimerLib/DebugAgentTimerLib.c b/Omap35xxPkg/Library/DebugAgentTimerLib/DebugAgentTimerLib.c
index 72b860361..1abdb63c7 100755
--- a/Omap35xxPkg/Library/DebugAgentTimerLib/DebugAgentTimerLib.c
+++ b/Omap35xxPkg/Library/DebugAgentTimerLib/DebugAgentTimerLib.c
@@ -77,19 +77,27 @@ DebugAgentTimerIntialize (
)
{
UINT32 TimerBaseAddress;
+ UINT32 TimerNumber;
-
- gVector = InterruptVectorForTimer (PcdGet32(PcdOmap35xxDebugAgentTimer));
+ TimerNumber = PcdGet32(PcdOmap35xxDebugAgentTimer);
+ gVector = InterruptVectorForTimer (TimerNumber);
// Set up the timer registers
- TimerBaseAddress = TimerBase (PcdGet32(PcdOmap35xxDebugAgentTimer));
+ TimerBaseAddress = TimerBase (TimerNumber);
gTISR = TimerBaseAddress + GPTIMER_TISR;
gTCLR = TimerBaseAddress + GPTIMER_TCLR;
gTLDR = TimerBaseAddress + GPTIMER_TLDR;
gTCRR = TimerBaseAddress + GPTIMER_TCRR;
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 ();
}
-
+
\ No newline at end of file