m68knommu: remove use of colfire_trap_init
[linux-2.6.git] / arch / m68knommu / platform / 5206e / config.c
blob4ab614f1ecdabb82b94e578ea42230e2e02c9776
1 /***************************************************************************/
3 /*
4 * linux/arch/m68knommu/platform/5206e/config.c
6 * Copyright (C) 1999-2002, Greg Ungerer (gerg@snapgear.com)
7 */
9 /***************************************************************************/
11 #include <linux/kernel.h>
12 #include <linux/sched.h>
13 #include <linux/param.h>
14 #include <linux/interrupt.h>
15 #include <asm/irq.h>
16 #include <asm/dma.h>
17 #include <asm/traps.h>
18 #include <asm/machdep.h>
19 #include <asm/coldfire.h>
20 #include <asm/mcftimer.h>
21 #include <asm/mcfsim.h>
22 #include <asm/mcfdma.h>
23 #include <asm/irq.h>
25 /***************************************************************************/
27 void coldfire_tick(void);
28 void coldfire_timer_init(irq_handler_t handler);
29 unsigned long coldfire_timer_offset(void);
30 void coldfire_reset(void);
32 /***************************************************************************/
35 * DMA channel base address table.
37 unsigned int dma_base_addr[MAX_M68K_DMA_CHANNELS] = {
38 MCF_MBAR + MCFDMA_BASE0,
39 MCF_MBAR + MCFDMA_BASE1,
42 unsigned int dma_device_address[MAX_M68K_DMA_CHANNELS];
44 /***************************************************************************/
46 void mcf_autovector(unsigned int vec)
48 volatile unsigned char *mbar;
49 unsigned char icr;
51 if ((vec >= 25) && (vec <= 31)) {
52 vec -= 25;
53 mbar = (volatile unsigned char *) MCF_MBAR;
54 icr = MCFSIM_ICR_AUTOVEC | (vec << 3);
55 *(mbar + MCFSIM_ICR1 + vec) = icr;
56 vec = 0x1 << (vec + 1);
57 mcf_setimr(mcf_getimr() & ~vec);
61 /***************************************************************************/
63 void mcf_settimericr(unsigned int timer, unsigned int level)
65 volatile unsigned char *icrp;
66 unsigned int icr, imr;
68 if (timer <= 2) {
69 switch (timer) {
70 case 2: icr = MCFSIM_TIMER2ICR; imr = MCFSIM_IMR_TIMER2; break;
71 default: icr = MCFSIM_TIMER1ICR; imr = MCFSIM_IMR_TIMER1; break;
74 icrp = (volatile unsigned char *) (MCF_MBAR + icr);
75 *icrp = MCFSIM_ICR_AUTOVEC | (level << 2) | MCFSIM_ICR_PRI3;
76 mcf_setimr(mcf_getimr() & ~imr);
80 /***************************************************************************/
82 int mcf_timerirqpending(int timer)
84 unsigned int imr = 0;
86 switch (timer) {
87 case 1: imr = MCFSIM_IMR_TIMER1; break;
88 case 2: imr = MCFSIM_IMR_TIMER2; break;
89 default: break;
91 return (mcf_getipr() & imr);
94 /***************************************************************************/
96 void config_BSP(char *commandp, int size)
98 mcf_setimr(MCFSIM_IMR_MASKALL);
100 #if defined(CONFIG_NETtel)
101 /* Copy command line from FLASH to local buffer... */
102 memcpy(commandp, (char *) 0xf0004000, size);
103 commandp[size-1] = 0;
104 #endif /* CONFIG_NETtel */
106 mach_sched_init = coldfire_timer_init;
107 mach_tick = coldfire_tick;
108 mach_gettimeoffset = coldfire_timer_offset;
109 mach_reset = coldfire_reset;
112 /***************************************************************************/