1 /***************************************************************************/
4 * linux/arch/m68knommu/platform/5407/config.c
6 * Copyright (C) 1999-2002, Greg Ungerer (gerg@snapgear.com)
7 * Copyright (C) 2000, Lineo (www.lineo.com)
10 /***************************************************************************/
12 #include <linux/kernel.h>
13 #include <linux/param.h>
14 #include <linux/init.h>
15 #include <linux/interrupt.h>
17 #include <asm/machdep.h>
18 #include <asm/coldfire.h>
19 #include <asm/mcfsim.h>
20 #include <asm/mcfdma.h>
22 /***************************************************************************/
24 void coldfire_reset(void);
26 extern unsigned int mcf_timervector;
27 extern unsigned int mcf_profilevector;
28 extern unsigned int mcf_timerlevel;
30 /***************************************************************************/
33 * DMA channel base address table.
35 unsigned int dma_base_addr[MAX_M68K_DMA_CHANNELS] = {
36 MCF_MBAR + MCFDMA_BASE0,
37 MCF_MBAR + MCFDMA_BASE1,
38 MCF_MBAR + MCFDMA_BASE2,
39 MCF_MBAR + MCFDMA_BASE3,
42 unsigned int dma_device_address[MAX_M68K_DMA_CHANNELS];
44 /***************************************************************************/
46 void mcf_autovector(unsigned int vec)
48 volatile unsigned char *mbar;
50 if ((vec >= 25) && (vec <= 31)) {
51 mbar = (volatile unsigned char *) MCF_MBAR;
52 vec = 0x1 << (vec - 24);
53 *(mbar + MCFSIM_AVR) |= vec;
54 mcf_setimr(mcf_getimr() & ~vec);
58 /***************************************************************************/
60 void mcf_settimericr(unsigned int timer, unsigned int level)
62 volatile unsigned char *icrp;
63 unsigned int icr, imr;
67 case 2: icr = MCFSIM_TIMER2ICR; imr = MCFSIM_IMR_TIMER2; break;
68 default: icr = MCFSIM_TIMER1ICR; imr = MCFSIM_IMR_TIMER1; break;
71 icrp = (volatile unsigned char *) (MCF_MBAR + icr);
72 *icrp = MCFSIM_ICR_AUTOVEC | (level << 2) | MCFSIM_ICR_PRI3;
73 mcf_setimr(mcf_getimr() & ~imr);
77 /***************************************************************************/
79 int mcf_timerirqpending(int timer)
84 case 1: imr = MCFSIM_IMR_TIMER1; break;
85 case 2: imr = MCFSIM_IMR_TIMER2; break;
88 return (mcf_getipr() & imr);
91 /***************************************************************************/
93 void config_BSP(char *commandp, int size)
95 mcf_setimr(MCFSIM_IMR_MASKALL);
97 #if defined(CONFIG_CLEOPATRA)
98 /* Different timer setup - to prevent device clash */
100 mcf_profilevector = 31;
104 mach_reset = coldfire_reset;
107 /***************************************************************************/