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/param.h>
14 #include <linux/init.h>
15 #include <linux/interrupt.h>
17 #include <asm/machdep.h>
18 #include <asm/coldfire.h>
19 #include <asm/mcfsim.h>
20 #include <asm/mcfdma.h>
22 /***************************************************************************/
24 void coldfire_reset(void);
26 extern unsigned int mcf_timervector;
27 extern unsigned int mcf_profilevector;
28 extern unsigned int mcf_timerlevel;
30 /***************************************************************************/
33 * Some platforms need software versions of the GPIO data registers.
35 unsigned short ppdata;
36 unsigned char ledbank = 0xff;
38 /***************************************************************************/
41 * DMA channel base address table.
43 unsigned int dma_base_addr[MAX_M68K_DMA_CHANNELS] = {
44 MCF_MBAR + MCFDMA_BASE0,
47 unsigned int dma_device_address[MAX_M68K_DMA_CHANNELS];
49 /***************************************************************************/
51 void mcf_disableall(void)
53 volatile unsigned long *icrp;
55 icrp = (volatile unsigned long *) (MCF_MBAR + MCFSIM_ICR1);
62 /***************************************************************************/
64 void mcf_autovector(unsigned int vec)
66 /* Everything is auto-vectored on the 5272 */
69 /***************************************************************************/
71 void mcf_settimericr(int timer, int level)
73 volatile unsigned long *icrp;
75 if ((timer >= 1 ) && (timer <= 4)) {
76 icrp = (volatile unsigned long *) (MCF_MBAR + MCFSIM_ICR1);
77 *icrp = (0x8 | level) << ((4 - timer) * 4);
81 /***************************************************************************/
83 int mcf_timerirqpending(int timer)
85 volatile unsigned long *icrp;
87 if ((timer >= 1 ) && (timer <= 4)) {
88 icrp = (volatile unsigned long *) (MCF_MBAR + MCFSIM_ICR1);
89 return (*icrp & (0x8 << ((4 - timer) * 4)));
94 /***************************************************************************/
96 void config_BSP(char *commandp, int size)
98 #if defined (CONFIG_MOD5272)
99 volatile unsigned char *pivrp;
101 /* Set base of device vectors to be 64 */
102 pivrp = (volatile unsigned char *) (MCF_MBAR + MCFSIM_PIVR);
108 #if defined(CONFIG_NETtel) || defined(CONFIG_SCALES)
109 /* Copy command line from FLASH to local buffer... */
110 memcpy(commandp, (char *) 0xf0004000, size);
111 commandp[size-1] = 0;
112 #elif defined(CONFIG_MTD_KeyTechnology)
113 /* Copy command line from FLASH to local buffer... */
114 memcpy(commandp, (char *) 0xffe06000, size);
115 commandp[size-1] = 0;
116 #elif defined(CONFIG_CANCam)
117 /* Copy command line from FLASH to local buffer... */
118 memcpy(commandp, (char *) 0xf0010000, size);
119 commandp[size-1] = 0;
122 mcf_timervector = 69;
123 mcf_profilevector = 70;
124 mach_reset = coldfire_reset;
127 /***************************************************************************/