diff options
author | Greg Ungerer <gerg@snapgear.com> | 2005-11-06 23:09:50 -0500 |
---|---|---|
committer | Linus Torvalds <torvalds@g5.osdl.org> | 2005-11-07 11:00:46 -0500 |
commit | f15bf19b49854c984c27209bd4ade31a9c84f4de (patch) | |
tree | f59e5b4fa5659749110800239e1f73cb9b8f35d2 /arch/m68knommu | |
parent | 88a605b02449852213a46f8a8ab760cfc5b9b7c8 (diff) |
[PATCH] m68knommu: modify the ColdFire PIT timer for new 5208
Modified common ColdFire PIT timer code to support the 5208 as well.
It uses a different set of mask and interrupt bits than other ColdFire
processors. The defines for these bits have been moved in header
files and set appropriately for the different processor varients.
Patch originally from Matt Waddel.
Signed-off-by: Greg Ungerer <gerg@uclinux.com>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
Diffstat (limited to 'arch/m68knommu')
-rw-r--r-- | arch/m68knommu/platform/5307/pit.c | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/arch/m68knommu/platform/5307/pit.c b/arch/m68knommu/platform/5307/pit.c index a9b2c2e7e280..323f2677e49d 100644 --- a/arch/m68knommu/platform/5307/pit.c +++ b/arch/m68knommu/platform/5307/pit.c | |||
@@ -3,7 +3,7 @@ | |||
3 | /* | 3 | /* |
4 | * pit.c -- Motorola ColdFire PIT timer. Currently this type of | 4 | * pit.c -- Motorola ColdFire PIT timer. Currently this type of |
5 | * hardware timer only exists in the Motorola ColdFire | 5 | * hardware timer only exists in the Motorola ColdFire |
6 | * 5270/5271 and 5282 CPUs. | 6 | * 5270/5271, 5282 and other CPUs. |
7 | * | 7 | * |
8 | * Copyright (C) 1999-2004, Greg Ungerer (gerg@snapgear.com) | 8 | * Copyright (C) 1999-2004, Greg Ungerer (gerg@snapgear.com) |
9 | * Copyright (C) 2001-2004, SnapGear Inc. (www.snapgear.com) | 9 | * Copyright (C) 2001-2004, SnapGear Inc. (www.snapgear.com) |
@@ -47,10 +47,10 @@ void coldfire_pit_init(irqreturn_t (*handler)(int, void *, struct pt_regs *)) | |||
47 | 47 | ||
48 | icrp = (volatile unsigned char *) (MCF_IPSBAR + MCFICM_INTC0 + | 48 | icrp = (volatile unsigned char *) (MCF_IPSBAR + MCFICM_INTC0 + |
49 | MCFINTC_ICR0 + MCFINT_PIT1); | 49 | MCFINTC_ICR0 + MCFINT_PIT1); |
50 | *icrp = 0x2b; /* PIT1 with level 5, priority 3 */ | 50 | *icrp = ICR_INTRCONF; |
51 | 51 | ||
52 | imrp = (volatile unsigned long *) (MCF_IPSBAR + MCFICM_INTC0 + MCFINTC_IMRH); | 52 | imrp = (volatile unsigned long *) (MCF_IPSBAR + MCFICM_INTC0 + MCFPIT_IMR); |
53 | *imrp &= ~(1 << (MCFINT_PIT1 - 32)); | 53 | *imrp &= ~MCFPIT_IMR_IBIT; |
54 | 54 | ||
55 | /* Set up PIT timer 1 as poll clock */ | 55 | /* Set up PIT timer 1 as poll clock */ |
56 | tp = (volatile struct mcfpit *) (MCF_IPSBAR + MCFPIT_BASE1); | 56 | tp = (volatile struct mcfpit *) (MCF_IPSBAR + MCFPIT_BASE1); |
@@ -70,7 +70,7 @@ unsigned long coldfire_pit_offset(void) | |||
70 | unsigned long pmr, pcntr, offset; | 70 | unsigned long pmr, pcntr, offset; |
71 | 71 | ||
72 | tp = (volatile struct mcfpit *) (MCF_IPSBAR + MCFPIT_BASE1); | 72 | tp = (volatile struct mcfpit *) (MCF_IPSBAR + MCFPIT_BASE1); |
73 | ipr = (volatile unsigned long *) (MCF_IPSBAR + MCFICM_INTC0 + MCFINTC_IPRH); | 73 | ipr = (volatile unsigned long *) (MCF_IPSBAR + MCFICM_INTC0 + MCFPIT_IMR); |
74 | 74 | ||
75 | pmr = *(&tp->pmr); | 75 | pmr = *(&tp->pmr); |
76 | pcntr = *(&tp->pcntr); | 76 | pcntr = *(&tp->pcntr); |
@@ -80,7 +80,7 @@ unsigned long coldfire_pit_offset(void) | |||
80 | * timer interupt is pending, then add on a ticks worth of time. | 80 | * timer interupt is pending, then add on a ticks worth of time. |
81 | */ | 81 | */ |
82 | offset = ((pmr - pcntr) * (1000000 / HZ)) / pmr; | 82 | offset = ((pmr - pcntr) * (1000000 / HZ)) / pmr; |
83 | if ((offset < (1000000 / HZ / 2)) && (*ipr & (1 << (MCFINT_PIT1 - 32)))) | 83 | if ((offset < (1000000 / HZ / 2)) && (*ipr & MCFPIT_IMR_IBIT)) |
84 | offset += 1000000 / HZ; | 84 | offset += 1000000 / HZ; |
85 | return offset; | 85 | return offset; |
86 | } | 86 | } |