1 /***************************************************************************/
4 * linux/arch/m68knommu/platform/5206e/config.c
6 * Copyright (C) 1999-2002, Greg Ungerer (gerg@snapgear.com)
9 /***************************************************************************/
11 #include <linux/kernel.h>
12 #include <linux/param.h>
13 #include <linux/interrupt.h>
15 #include <asm/machdep.h>
16 #include <asm/coldfire.h>
17 #include <asm/mcfsim.h>
18 #include <asm/mcfdma.h>
20 /***************************************************************************/
22 void coldfire_reset(void);
24 /***************************************************************************/
27 * DMA channel base address table.
29 unsigned int dma_base_addr[MAX_M68K_DMA_CHANNELS] = {
30 MCF_MBAR + MCFDMA_BASE0,
31 MCF_MBAR + MCFDMA_BASE1,
34 unsigned int dma_device_address[MAX_M68K_DMA_CHANNELS];
36 /***************************************************************************/
38 void mcf_autovector(unsigned int vec)
40 volatile unsigned char *mbar;
43 if ((vec >= 25) && (vec <= 31)) {
45 mbar = (volatile unsigned char *) MCF_MBAR;
46 icr = MCFSIM_ICR_AUTOVEC | (vec << 3);
47 *(mbar + MCFSIM_ICR1 + vec) = icr;
48 vec = 0x1 << (vec + 1);
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);
92 #if defined(CONFIG_NETtel)
93 /* Copy command line from FLASH to local buffer... */
94 memcpy(commandp, (char *) 0xf0004000, size);
96 #endif /* CONFIG_NETtel */
98 mach_reset = coldfire_reset;
101 /***************************************************************************/