1 /***************************************************************************/
4 * linux/arch/m68knommu/platform/5206/config.c
6 * Copyright (C) 1999-2002, Greg Ungerer (gerg@snapgear.com)
7 * Copyright (C) 2000-2001, Lineo Inc. (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/mcftimer.h>
20 #include <asm/mcfsim.h>
21 #include <asm/mcfdma.h>
23 /***************************************************************************/
25 void coldfire_reset(void);
27 /***************************************************************************/
30 * DMA channel base address table.
32 unsigned int dma_base_addr[MAX_M68K_DMA_CHANNELS] = {
33 MCF_MBAR + MCFDMA_BASE0,
34 MCF_MBAR + MCFDMA_BASE1,
37 unsigned int dma_device_address[MAX_M68K_DMA_CHANNELS];
39 /***************************************************************************/
41 void mcf_autovector(unsigned int vec)
43 volatile unsigned char *mbar;
46 if ((vec >= 25) && (vec <= 31)) {
48 mbar = (volatile unsigned char *) MCF_MBAR;
49 icr = MCFSIM_ICR_AUTOVEC | (vec << 3);
50 *(mbar + MCFSIM_ICR1 + vec) = icr;
51 vec = 0x1 << (vec + 1);
52 mcf_setimr(mcf_getimr() & ~vec);
56 /***************************************************************************/
58 void mcf_settimericr(unsigned int timer, unsigned int level)
60 volatile unsigned char *icrp;
61 unsigned int icr, imr;
65 case 2: icr = MCFSIM_TIMER2ICR; imr = MCFSIM_IMR_TIMER2; break;
66 default: icr = MCFSIM_TIMER1ICR; imr = MCFSIM_IMR_TIMER1; break;
69 icrp = (volatile unsigned char *) (MCF_MBAR + icr);
70 *icrp = MCFSIM_ICR_AUTOVEC | (level << 2) | MCFSIM_ICR_PRI3;
71 mcf_setimr(mcf_getimr() & ~imr);
75 /***************************************************************************/
77 int mcf_timerirqpending(int timer)
82 case 1: imr = MCFSIM_IMR_TIMER1; break;
83 case 2: imr = MCFSIM_IMR_TIMER2; break;
86 return (mcf_getipr() & imr);
89 /***************************************************************************/
91 void config_BSP(char *commandp, int size)
93 mcf_setimr(MCFSIM_IMR_MASKALL);
94 mach_reset = coldfire_reset;
97 /***************************************************************************/