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>
27 /***************************************************************************/
29 void coldfire_tick(void);
30 void coldfire_timer_init(irqreturn_t (*handler)(int, void *, struct pt_regs *));
31 unsigned long coldfire_timer_offset(void);
32 void coldfire_trap_init(void);
33 void coldfire_reset(void);
35 extern unsigned int mcf_timervector;
36 extern unsigned int mcf_profilevector;
37 extern unsigned int mcf_timerlevel;
39 /***************************************************************************/
42 * DMA channel base address table.
44 unsigned int dma_base_addr[MAX_M68K_DMA_CHANNELS] = {
45 MCF_MBAR + MCFDMA_BASE0,
48 unsigned int dma_device_address[MAX_M68K_DMA_CHANNELS];
50 /***************************************************************************/
52 void mcf_disableall(void)
54 volatile unsigned long *icrp;
56 icrp = (volatile unsigned long *) (MCF_MBAR + MCFSIM_ICR1);
63 /***************************************************************************/
65 void mcf_autovector(unsigned int vec)
67 /* Everything is auto-vectored on the 5272 */
70 /***************************************************************************/
72 void mcf_settimericr(int timer, int level)
74 volatile unsigned long *icrp;
76 if ((timer >= 1 ) && (timer <= 4)) {
77 icrp = (volatile unsigned long *) (MCF_MBAR + MCFSIM_ICR1);
78 *icrp = (0x8 | level) << ((4 - timer) * 4);
82 /***************************************************************************/
84 int mcf_timerirqpending(int timer)
86 volatile unsigned long *icrp;
88 if ((timer >= 1 ) && (timer <= 4)) {
89 icrp = (volatile unsigned long *) (MCF_MBAR + MCFSIM_ICR1);
90 return (*icrp & (0x8 << ((4 - timer) * 4)));
95 /***************************************************************************/
97 void config_BSP(char *commandp, int size)
100 volatile unsigned long *pivrp;
102 /* Set base of device vectors to be 64 */
103 pivrp = (volatile unsigned long *) (MCF_MBAR + MCFSIM_PIVR);
109 #if defined(CONFIG_BOOTPARAM)
110 strncpy(commandp, CONFIG_BOOTPARAM_STRING, size);
111 commandp[size-1] = 0;
112 #elif defined(CONFIG_NETtel) || defined(CONFIG_SCALES)
113 /* Copy command line from FLASH to local buffer... */
114 memcpy(commandp, (char *) 0xf0004000, size);
115 commandp[size-1] = 0;
116 #elif defined(CONFIG_MTD_KeyTechnology)
117 /* Copy command line from FLASH to local buffer... */
118 memcpy(commandp, (char *) 0xffe06000, size);
119 commandp[size-1] = 0;
120 #elif defined(CONFIG_CANCam)
121 /* Copy command line from FLASH to local buffer... */
122 memcpy(commandp, (char *) 0xf0010000, size);
123 commandp[size-1] = 0;
125 memset(commandp, 0, size);
128 mcf_timervector = 69;
129 mcf_profilevector = 70;
130 mach_sched_init = coldfire_timer_init;
131 mach_tick = coldfire_tick;
132 mach_gettimeoffset = coldfire_timer_offset;
133 mach_trap_init = coldfire_trap_init;
134 mach_reset = coldfire_reset;
137 /***************************************************************************/