m68knommu: get rid of duplicate include
[powerpc.git] / arch / m68knommu / platform / 5206e / config.c
1 /***************************************************************************/
2
3 /*
4  *      linux/arch/m68knommu/platform/5206e/config.c
5  *
6  *      Copyright (C) 1999-2002, Greg Ungerer (gerg@snapgear.com)
7  */
8
9 /***************************************************************************/
10
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
24 /***************************************************************************/
25
26 void coldfire_tick(void);
27 void coldfire_timer_init(irq_handler_t handler);
28 unsigned long coldfire_timer_offset(void);
29 void coldfire_reset(void);
30
31 /***************************************************************************/
32
33 /*
34  *      DMA channel base address table.
35  */
36 unsigned int   dma_base_addr[MAX_M68K_DMA_CHANNELS] = {
37         MCF_MBAR + MCFDMA_BASE0,
38         MCF_MBAR + MCFDMA_BASE1,
39 };
40
41 unsigned int dma_device_address[MAX_M68K_DMA_CHANNELS];
42
43 /***************************************************************************/
44
45 void mcf_autovector(unsigned int vec)
46 {
47         volatile unsigned char  *mbar;
48         unsigned char           icr;
49
50         if ((vec >= 25) && (vec <= 31)) {
51                 vec -= 25;
52                 mbar = (volatile unsigned char *) MCF_MBAR;
53                 icr = MCFSIM_ICR_AUTOVEC | (vec << 3);
54                 *(mbar + MCFSIM_ICR1 + vec) = icr;
55                 vec = 0x1 << (vec + 1);
56                 mcf_setimr(mcf_getimr() & ~vec);
57         }
58 }
59
60 /***************************************************************************/
61
62 void mcf_settimericr(unsigned int timer, unsigned int level)
63 {
64         volatile unsigned char *icrp;
65         unsigned int icr, imr;
66
67         if (timer <= 2) {
68                 switch (timer) {
69                 case 2:  icr = MCFSIM_TIMER2ICR; imr = MCFSIM_IMR_TIMER2; break;
70                 default: icr = MCFSIM_TIMER1ICR; imr = MCFSIM_IMR_TIMER1; break;
71                 }
72
73                 icrp = (volatile unsigned char *) (MCF_MBAR + icr);
74                 *icrp = MCFSIM_ICR_AUTOVEC | (level << 2) | MCFSIM_ICR_PRI3;
75                 mcf_setimr(mcf_getimr() & ~imr);
76         }
77 }
78
79 /***************************************************************************/
80
81 int mcf_timerirqpending(int timer)
82 {
83         unsigned int imr = 0;
84
85         switch (timer) {
86         case 1:  imr = MCFSIM_IMR_TIMER1; break;
87         case 2:  imr = MCFSIM_IMR_TIMER2; break;
88         default: break;
89         }
90         return (mcf_getipr() & imr);
91 }
92
93 /***************************************************************************/
94
95 void config_BSP(char *commandp, int size)
96 {
97         mcf_setimr(MCFSIM_IMR_MASKALL);
98
99 #if defined(CONFIG_NETtel)
100         /* Copy command line from FLASH to local buffer... */
101         memcpy(commandp, (char *) 0xf0004000, size);
102         commandp[size-1] = 0;
103 #endif /* CONFIG_NETtel */
104
105         mach_sched_init = coldfire_timer_init;
106         mach_tick = coldfire_tick;
107         mach_gettimeoffset = coldfire_timer_offset;
108         mach_reset = coldfire_reset;
109 }
110
111 /***************************************************************************/