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 * Some platforms need software versions of the GPIO data registers.
44 unsigned short ppdata
;
45 unsigned char ledbank
= 0xff;
47 /***************************************************************************/
50 * DMA channel base address table.
52 unsigned int dma_base_addr
[MAX_M68K_DMA_CHANNELS
] = {
53 MCF_MBAR
+ MCFDMA_BASE0
,
56 unsigned int dma_device_address
[MAX_M68K_DMA_CHANNELS
];
58 /***************************************************************************/
60 void mcf_disableall(void)
62 volatile unsigned long *icrp
;
64 icrp
= (volatile unsigned long *) (MCF_MBAR
+ MCFSIM_ICR1
);
71 /***************************************************************************/
73 void mcf_autovector(unsigned int vec
)
75 /* Everything is auto-vectored on the 5272 */
78 /***************************************************************************/
80 void mcf_settimericr(int timer
, int level
)
82 volatile unsigned long *icrp
;
84 if ((timer
>= 1 ) && (timer
<= 4)) {
85 icrp
= (volatile unsigned long *) (MCF_MBAR
+ MCFSIM_ICR1
);
86 *icrp
= (0x8 | level
) << ((4 - timer
) * 4);
90 /***************************************************************************/
92 int mcf_timerirqpending(int timer
)
94 volatile unsigned long *icrp
;
96 if ((timer
>= 1 ) && (timer
<= 4)) {
97 icrp
= (volatile unsigned long *) (MCF_MBAR
+ MCFSIM_ICR1
);
98 return (*icrp
& (0x8 << ((4 - timer
) * 4)));
103 /***************************************************************************/
105 void config_BSP(char *commandp
, int size
)
107 #if defined (CONFIG_MOD5272)
108 volatile unsigned char *pivrp
;
110 /* Set base of device vectors to be 64 */
111 pivrp
= (volatile unsigned char *) (MCF_MBAR
+ MCFSIM_PIVR
);
117 #if defined(CONFIG_BOOTPARAM)
118 strncpy(commandp
, CONFIG_BOOTPARAM_STRING
, size
);
119 commandp
[size
-1] = 0;
120 #elif defined(CONFIG_NETtel) || defined(CONFIG_SCALES)
121 /* Copy command line from FLASH to local buffer... */
122 memcpy(commandp
, (char *) 0xf0004000, size
);
123 commandp
[size
-1] = 0;
124 #elif defined(CONFIG_MTD_KeyTechnology)
125 /* Copy command line from FLASH to local buffer... */
126 memcpy(commandp
, (char *) 0xffe06000, size
);
127 commandp
[size
-1] = 0;
128 #elif defined(CONFIG_CANCam)
129 /* Copy command line from FLASH to local buffer... */
130 memcpy(commandp
, (char *) 0xf0010000, size
);
131 commandp
[size
-1] = 0;
133 memset(commandp
, 0, size
);
136 mcf_timervector
= 69;
137 mcf_profilevector
= 70;
138 mach_sched_init
= coldfire_timer_init
;
139 mach_tick
= coldfire_tick
;
140 mach_gettimeoffset
= coldfire_timer_offset
;
141 mach_trap_init
= coldfire_trap_init
;
142 mach_reset
= coldfire_reset
;
145 /***************************************************************************/