1 /***************************************************************************/
4 * linux/arch/m68knommu/platform/5272/config.c
6 * Copyright (C) 1999-2002, Greg Ungerer (gerg@snapgear.com)
7 * Copyright (C) 2001-2002, SnapGear Inc. (www.snapgear.com)
10 /***************************************************************************/
12 #include <linux/config.h>
13 #include <linux/kernel.h>
14 #include <linux/sched.h>
15 #include <linux/param.h>
16 #include <linux/init.h>
17 #include <linux/interrupt.h>
20 #include <asm/traps.h>
21 #include <asm/machdep.h>
22 #include <asm/coldfire.h>
23 #include <asm/mcftimer.h>
24 #include <asm/mcfsim.h>
25 #include <asm/mcfdma.h>
26 #include <asm/delay.h>
28 /***************************************************************************/
30 void coldfire_tick(void);
31 void coldfire_timer_init(irqreturn_t (*handler)(int, void *, struct pt_regs *));
32 unsigned long coldfire_timer_offset(void);
33 void coldfire_trap_init(void);
34 void coldfire_reset(void);
36 extern unsigned int mcf_timervector;
37 extern unsigned int mcf_profilevector;
38 extern unsigned int mcf_timerlevel;
40 /***************************************************************************/
43 * DMA channel base address table.
45 unsigned int dma_base_addr[MAX_M68K_DMA_CHANNELS] = {
46 MCF_MBAR + MCFDMA_BASE0,
49 unsigned int dma_device_address[MAX_M68K_DMA_CHANNELS];
51 /***************************************************************************/
53 void mcf_disableall(void)
55 volatile unsigned long *icrp;
57 icrp = (volatile unsigned long *) (MCF_MBAR + MCFSIM_ICR1);
64 /***************************************************************************/
66 void mcf_autovector(unsigned int vec)
68 /* Everything is auto-vectored on the 5272 */
71 /***************************************************************************/
73 void mcf_settimericr(int timer, int level)
75 volatile unsigned long *icrp;
77 if ((timer >= 1 ) && (timer <= 4)) {
78 icrp = (volatile unsigned long *) (MCF_MBAR + MCFSIM_ICR1);
79 *icrp = (0x8 | level) << ((4 - timer) * 4);
83 /***************************************************************************/
85 int mcf_timerirqpending(int timer)
87 volatile unsigned long *icrp;
89 if ((timer >= 1 ) && (timer <= 4)) {
90 icrp = (volatile unsigned long *) (MCF_MBAR + MCFSIM_ICR1);
91 return (*icrp & (0x8 << ((4 - timer) * 4)));
96 /***************************************************************************/
98 void config_BSP(char *commandp, int size)
101 volatile unsigned long *pivrp;
103 /* Set base of device vectors to be 64 */
104 pivrp = (volatile unsigned long *) (MCF_MBAR + MCFSIM_PIVR);
110 #if defined(CONFIG_BOOTPARAM)
111 strncpy(commandp, CONFIG_BOOTPARAM_STRING, size);
112 commandp[size-1] = 0;
113 #elif defined(CONFIG_NETtel)
114 /* Copy command line from FLASH to local buffer... */
115 memcpy(commandp, (char *) 0xf0004000, size);
116 commandp[size-1] = 0;
117 #elif defined(CONFIG_MTD_KeyTechnology)
118 /* Copy command line from FLASH to local buffer... */
119 memcpy(commandp, (char *) 0xffe06000, size);
120 commandp[size-1] = 0;
122 memset(commandp, 0, size);
125 mcf_timervector = 69;
126 mcf_profilevector = 70;
127 mach_sched_init = coldfire_timer_init;
128 mach_tick = coldfire_tick;
129 mach_gettimeoffset = coldfire_timer_offset;
130 mach_trap_init = coldfire_trap_init;
131 mach_reset = coldfire_reset;
134 /***************************************************************************/