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/kernel.h>
13 #include <linux/sched.h>
14 #include <linux/param.h>
15 #include <linux/init.h>
16 #include <linux/interrupt.h>
19 #include <asm/traps.h>
20 #include <asm/machdep.h>
21 #include <asm/coldfire.h>
22 #include <asm/mcftimer.h>
23 #include <asm/mcfsim.h>
24 #include <asm/mcfdma.h>
26 /***************************************************************************/
28 void coldfire_tick(void);
29 void coldfire_timer_init(irq_handler_t handler);
30 unsigned long coldfire_timer_offset(void);
31 void coldfire_reset(void);
33 extern unsigned int mcf_timervector;
34 extern unsigned int mcf_profilevector;
35 extern unsigned int mcf_timerlevel;
37 /***************************************************************************/
40 * Some platforms need software versions of the GPIO data registers.
42 unsigned short ppdata;
43 unsigned char ledbank = 0xff;
45 /***************************************************************************/
48 * DMA channel base address table.
50 unsigned int dma_base_addr[MAX_M68K_DMA_CHANNELS] = {
51 MCF_MBAR + MCFDMA_BASE0,
54 unsigned int dma_device_address[MAX_M68K_DMA_CHANNELS];
56 /***************************************************************************/
58 void mcf_disableall(void)
60 volatile unsigned long *icrp;
62 icrp = (volatile unsigned long *) (MCF_MBAR + MCFSIM_ICR1);
69 /***************************************************************************/
71 void mcf_autovector(unsigned int vec)
73 /* Everything is auto-vectored on the 5272 */
76 /***************************************************************************/
78 void mcf_settimericr(int timer, int level)
80 volatile unsigned long *icrp;
82 if ((timer >= 1 ) && (timer <= 4)) {
83 icrp = (volatile unsigned long *) (MCF_MBAR + MCFSIM_ICR1);
84 *icrp = (0x8 | level) << ((4 - timer) * 4);
88 /***************************************************************************/
90 int mcf_timerirqpending(int timer)
92 volatile unsigned long *icrp;
94 if ((timer >= 1 ) && (timer <= 4)) {
95 icrp = (volatile unsigned long *) (MCF_MBAR + MCFSIM_ICR1);
96 return (*icrp & (0x8 << ((4 - timer) * 4)));
101 /***************************************************************************/
103 void config_BSP(char *commandp, int size)
105 #if defined (CONFIG_MOD5272)
106 volatile unsigned char *pivrp;
108 /* Set base of device vectors to be 64 */
109 pivrp = (volatile unsigned char *) (MCF_MBAR + MCFSIM_PIVR);
115 #if defined(CONFIG_NETtel) || defined(CONFIG_SCALES)
116 /* Copy command line from FLASH to local buffer... */
117 memcpy(commandp, (char *) 0xf0004000, size);
118 commandp[size-1] = 0;
119 #elif defined(CONFIG_MTD_KeyTechnology)
120 /* Copy command line from FLASH to local buffer... */
121 memcpy(commandp, (char *) 0xffe06000, size);
122 commandp[size-1] = 0;
123 #elif defined(CONFIG_CANCam)
124 /* Copy command line from FLASH to local buffer... */
125 memcpy(commandp, (char *) 0xf0010000, size);
126 commandp[size-1] = 0;
129 mcf_timervector = 69;
130 mcf_profilevector = 70;
131 mach_sched_init = coldfire_timer_init;
132 mach_tick = coldfire_tick;
133 mach_gettimeoffset = coldfire_timer_offset;
134 mach_reset = coldfire_reset;
137 /***************************************************************************/