/** @file\r
Debug Agent timer lib for OMAP 35xx.\r
\r
- Copyright (c) 2008-2010, Apple Inc. All rights reserved.\r
+ Copyright (c) 2008 - 2010, Apple Inc. All rights reserved.<BR>\r
\r
- All rights reserved. This program and the accompanying materials\r
+ This program and the accompanying materials\r
are licensed and made available under the terms and conditions of the BSD License\r
which accompanies this distribution. The full text of the license may be found at\r
http://opensource.org/licenses/bsd-license.php\r
)\r
{\r
UINT32 TimerBaseAddress;\r
+ UINT32 TimerNumber;\r
\r
-\r
- gVector = InterruptVectorForTimer (PcdGet32(PcdOmap35xxDebugAgentTimer));
+ TimerNumber = PcdGet32(PcdOmap35xxDebugAgentTimer);\r
+ gVector = InterruptVectorForTimer (TimerNumber);
\r
// 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;
\r
- DisableInterruptSource ();\r
+ if ((TimerNumber < 2) || (TimerNumber > 9)) {\r
+ // This code assumes one the General Purpose timers is used\r
+ // GPT2 - GPT9\r
+ CpuDeadLoop ();\r
+ }\r
+ // Set source clock for GPT2 - GPT9 to SYS_CLK\r
+ MmioOr32 (CM_CLKSEL_PER, 1 << (TimerNumber - 2)); \r
+\r
}\r
\r
\r
ArmDataSyncronizationBarrier ();\r
\r
}\r
- \r
+\r
\ No newline at end of file