aboutsummaryrefslogtreecommitdiffstats
path: root/arch/m68knommu/platform/5407/config.c
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@ppc970.osdl.org>2005-04-16 18:20:36 -0400
committerLinus Torvalds <torvalds@ppc970.osdl.org>2005-04-16 18:20:36 -0400
commit1da177e4c3f41524e886b7f1b8a0c1fc7321cac2 (patch)
tree0bba044c4ce775e45a88a51686b5d9f90697ea9d /arch/m68knommu/platform/5407/config.c
Linux-2.6.12-rc2v2.6.12-rc2
Initial git repository build. I'm not bothering with the full history, even though we have it. We can create a separate "historical" git archive of that later if we want to, and in the meantime it's about 3.2GB when imported into git - space that would just make the early git days unnecessarily complicated, when we don't have a lot of good infrastructure for it. Let it rip!
Diffstat (limited to 'arch/m68knommu/platform/5407/config.c')
-rw-r--r--arch/m68knommu/platform/5407/config.c127
1 files changed, 127 insertions, 0 deletions
diff --git a/arch/m68knommu/platform/5407/config.c b/arch/m68knommu/platform/5407/config.c
new file mode 100644
index 000000000000..f7c9018b85a7
--- /dev/null
+++ b/arch/m68knommu/platform/5407/config.c
@@ -0,0 +1,127 @@
1/***************************************************************************/
2
3/*
4 * linux/arch/m68knommu/platform/5407/config.c
5 *
6 * Copyright (C) 1999-2002, Greg Ungerer (gerg@snapgear.com)
7 * Copyright (C) 2000, Lineo (www.lineo.com)
8 */
9
10/***************************************************************************/
11
12#include <linux/config.h>
13#include <linux/kernel.h>
14#include <linux/sched.h>
15#include <linux/param.h>
16#include <linux/init.h>
17#include <linux/interrupt.h>
18#include <asm/irq.h>
19#include <asm/dma.h>
20#include <asm/traps.h>
21#include <asm/machdep.h>
22#include <asm/coldfire.h>
23#include <asm/mcftimer.h>
24#include <asm/mcfsim.h>
25#include <asm/mcfdma.h>
26
27/***************************************************************************/
28
29void coldfire_tick(void);
30void coldfire_timer_init(irqreturn_t (*handler)(int, void *, struct pt_regs *));
31unsigned long coldfire_timer_offset(void);
32void coldfire_trap_init(void);
33void coldfire_reset(void);
34
35extern unsigned int mcf_timervector;
36extern unsigned int mcf_profilevector;
37extern unsigned int mcf_timerlevel;
38
39/***************************************************************************/
40
41/*
42 * DMA channel base address table.
43 */
44unsigned int dma_base_addr[MAX_M68K_DMA_CHANNELS] = {
45 MCF_MBAR + MCFDMA_BASE0,
46 MCF_MBAR + MCFDMA_BASE1,
47 MCF_MBAR + MCFDMA_BASE2,
48 MCF_MBAR + MCFDMA_BASE3,
49};
50
51unsigned int dma_device_address[MAX_M68K_DMA_CHANNELS];
52
53/***************************************************************************/
54
55void mcf_autovector(unsigned int vec)
56{
57 volatile unsigned char *mbar;
58
59 if ((vec >= 25) && (vec <= 31)) {
60 mbar = (volatile unsigned char *) MCF_MBAR;
61 vec = 0x1 << (vec - 24);
62 *(mbar + MCFSIM_AVR) |= vec;
63 mcf_setimr(mcf_getimr() & ~vec);
64 }
65}
66
67/***************************************************************************/
68
69void mcf_settimericr(unsigned int timer, unsigned int level)
70{
71 volatile unsigned char *icrp;
72 unsigned int icr, imr;
73
74 if (timer <= 2) {
75 switch (timer) {
76 case 2: icr = MCFSIM_TIMER2ICR; imr = MCFSIM_IMR_TIMER2; break;
77 default: icr = MCFSIM_TIMER1ICR; imr = MCFSIM_IMR_TIMER1; break;
78 }
79
80 icrp = (volatile unsigned char *) (MCF_MBAR + icr);
81 *icrp = MCFSIM_ICR_AUTOVEC | (level << 2) | MCFSIM_ICR_PRI3;
82 mcf_setimr(mcf_getimr() & ~imr);
83 }
84}
85
86/***************************************************************************/
87
88int mcf_timerirqpending(int timer)
89{
90 unsigned int imr = 0;
91
92 switch (timer) {
93 case 1: imr = MCFSIM_IMR_TIMER1; break;
94 case 2: imr = MCFSIM_IMR_TIMER2; break;
95 default: break;
96 }
97 return (mcf_getipr() & imr);
98}
99
100/***************************************************************************/
101
102void config_BSP(char *commandp, int size)
103{
104 mcf_setimr(MCFSIM_IMR_MASKALL);
105
106#if defined(CONFIG_BOOTPARAM)
107 strncpy(commandp, CONFIG_BOOTPARAM_STRING, size);
108 commandp[size-1] = 0;
109#else
110 memset(commandp, 0, size);
111#endif
112
113#if defined(CONFIG_CLEOPATRA)
114 /* Different timer setup - to prevent device clash */
115 mcf_timervector = 30;
116 mcf_profilevector = 31;
117 mcf_timerlevel = 6;
118#endif
119
120 mach_sched_init = coldfire_timer_init;
121 mach_tick = coldfire_tick;
122 mach_gettimeoffset = coldfire_timer_offset;
123 mach_trap_init = coldfire_trap_init;
124 mach_reset = coldfire_reset;
125}
126
127/***************************************************************************/