aboutsummaryrefslogtreecommitdiffstats
path: root/os/hal/platforms/SPC564Axx/hal_lld.c
diff options
context:
space:
mode:
authorgdisirio <gdisirio@35acf78f-673a-0410-8e92-d51de3d6d3f4>2013-04-29 09:42:43 +0000
committergdisirio <gdisirio@35acf78f-673a-0410-8e92-d51de3d6d3f4>2013-04-29 09:42:43 +0000
commitf5a298cd4d6580728a1dc31577965b5ed3ab4cc8 (patch)
treebc819c95af4f1980a9dc45ec6f6034c85158cf90 /os/hal/platforms/SPC564Axx/hal_lld.c
parentac3085ebc9061107c6c9d488d8995e2174e2a089 (diff)
downloadChibiOS-f5a298cd4d6580728a1dc31577965b5ed3ab4cc8.tar.gz
ChibiOS-f5a298cd4d6580728a1dc31577965b5ed3ab4cc8.tar.bz2
ChibiOS-f5a298cd4d6580728a1dc31577965b5ed3ab4cc8.zip
git-svn-id: svn://svn.code.sf.net/p/chibios/svn/trunk@5646 35acf78f-673a-0410-8e92-d51de3d6d3f4
Diffstat (limited to 'os/hal/platforms/SPC564Axx/hal_lld.c')
-rw-r--r--os/hal/platforms/SPC564Axx/hal_lld.c17
1 files changed, 9 insertions, 8 deletions
diff --git a/os/hal/platforms/SPC564Axx/hal_lld.c b/os/hal/platforms/SPC564Axx/hal_lld.c
index c6c67ba31..908f06249 100644
--- a/os/hal/platforms/SPC564Axx/hal_lld.c
+++ b/os/hal/platforms/SPC564Axx/hal_lld.c
@@ -73,20 +73,21 @@ void hal_lld_init(void) {
EBI (7): 3
FlexRay (6): 4 */
- /* Downcounter timer initialized for system tick use, TB enabled for debug
- and measurements.*/
+ /* Decrementer timer initialized for system tick use, note, it is
+ initialized here because in the OSAL layer the system clock frequency
+ is not yet known.*/
n = SPC5_SYSCLK / CH_FREQUENCY;
- asm volatile ("li %%r3, 0 \t\n"
- "mtspr 284, %%r3 \t\n" /* Clear TBL register. */
- "mtspr 285, %%r3 \t\n" /* Clear TBU register. */
- "mtspr 22, %[n] \t\n" /* Init. DEC register. */
+ asm volatile ("mtspr 22, %[n] \t\n" /* Init. DEC register. */
"mtspr 54, %[n] \t\n" /* Init. DECAR register.*/
- "li %%r3, 0x4000 \t\n" /* TBEN bit. */
- "mtspr 1008, %%r3 \t\n" /* HID0 register. */
"lis %%r3, 0x0440 \t\n" /* DIE ARE bits. */
"mtspr 340, %%r3" /* TCR register. */
: : [n] "r" (n) : "r3");
+ /* TB counter enabled for debug and measurements.*/
+ asm volatile ("li %%r3, 0x4000 \t\n" /* TBEN bit. */
+ "mtspr 1008, %%r3" /* HID0 register. */
+ : : : "r3");
+
/* INTC initialization, software vector mode, 4 bytes vectors, starting
at priority 0.*/
INTC.MCR.R = 0;