1 /***************************************************************************/
4 * linux/arch/m68knommu/platform/5249/config.c
6 * Copyright (C) 2002, Greg Ungerer (gerg@snapgear.com)
9 /***************************************************************************/
11 #include <linux/kernel.h>
12 #include <linux/param.h>
13 #include <linux/init.h>
14 #include <linux/interrupt.h>
16 #include <asm/machdep.h>
17 #include <asm/coldfire.h>
18 #include <asm/mcfsim.h>
19 #include <asm/mcfdma.h>
21 /***************************************************************************/
23 void coldfire_reset(void);
25 /***************************************************************************/
28 * DMA channel base address table.
30 unsigned int dma_base_addr[MAX_M68K_DMA_CHANNELS] = {
31 MCF_MBAR + MCFDMA_BASE0,
32 MCF_MBAR + MCFDMA_BASE1,
33 MCF_MBAR + MCFDMA_BASE2,
34 MCF_MBAR + MCFDMA_BASE3,
37 unsigned int dma_device_address[MAX_M68K_DMA_CHANNELS];
39 /***************************************************************************/
41 void mcf_autovector(unsigned int vec)
43 volatile unsigned char *mbar;
45 if ((vec >= 25) && (vec <= 31)) {
46 mbar = (volatile unsigned char *) MCF_MBAR;
47 vec = 0x1 << (vec - 24);
48 *(mbar + MCFSIM_AVR) |= vec;
49 mcf_setimr(mcf_getimr() & ~vec);
53 /***************************************************************************/
55 void mcf_settimericr(unsigned int timer, unsigned int level)
57 volatile unsigned char *icrp;
58 unsigned int icr, imr;
62 case 2: icr = MCFSIM_TIMER2ICR; imr = MCFSIM_IMR_TIMER2; break;
63 default: icr = MCFSIM_TIMER1ICR; imr = MCFSIM_IMR_TIMER1; break;
66 icrp = (volatile unsigned char *) (MCF_MBAR + icr);
67 *icrp = MCFSIM_ICR_AUTOVEC | (level << 2) | MCFSIM_ICR_PRI3;
68 mcf_setimr(mcf_getimr() & ~imr);
72 /***************************************************************************/
74 int mcf_timerirqpending(int timer)
79 case 1: imr = MCFSIM_IMR_TIMER1; break;
80 case 2: imr = MCFSIM_IMR_TIMER2; break;
83 return (mcf_getipr() & imr);
86 /***************************************************************************/
88 void config_BSP(char *commandp, int size)
90 mcf_setimr(MCFSIM_IMR_MASKALL);
91 mach_reset = coldfire_reset;
94 /***************************************************************************/