1 /***************************************************************************/
4 * linux/arch/m68knommu/platform/528x/config.c
6 * Sub-architcture dependent initialization code for the Freescale
7 * 5280, 5281 and 5282 CPUs.
9 * Copyright (C) 1999-2003, Greg Ungerer (gerg@snapgear.com)
10 * Copyright (C) 2001-2003, SnapGear Inc. (www.snapgear.com)
13 /***************************************************************************/
15 #include <linux/kernel.h>
16 #include <linux/param.h>
17 #include <linux/init.h>
18 #include <linux/platform_device.h>
20 #include <asm/machdep.h>
21 #include <asm/coldfire.h>
22 #include <asm/mcfsim.h>
23 #include <asm/mcfuart.h>
25 /***************************************************************************/
27 #ifdef CONFIG_SPI_COLDFIRE_QSPI
29 static void __init m528x_qspi_init(void)
31 /* setup Port QS for QSPI with gpio CS control */
32 __raw_writeb(0x07, MCFGPIO_PQSPAR);
35 #endif /* CONFIG_SPI_COLDFIRE_QSPI */
37 /***************************************************************************/
39 static void __init m528x_uarts_init(void)
43 /* make sure PUAPAR is set for UART0 and UART1 */
44 port = readb(MCF5282_GPIO_PUAPAR);
45 port |= 0x03 | (0x03 << 2);
46 writeb(port, MCF5282_GPIO_PUAPAR);
49 /***************************************************************************/
51 static void __init m528x_fec_init(void)
55 /* Set multi-function pins to ethernet mode for fec0 */
56 v16 = readw(MCF_IPSBAR + 0x100056);
57 writew(v16 | 0xf00, MCF_IPSBAR + 0x100056);
58 writeb(0xc0, MCF_IPSBAR + 0x100058);
61 /***************************************************************************/
63 #ifdef CONFIG_WILDFIRE
64 void wildfire_halt(void)
66 writeb(0, 0x30000007);
67 writeb(0x2, 0x30000007);
71 #ifdef CONFIG_WILDFIREMOD
72 void wildfiremod_halt(void)
74 printk(KERN_INFO "WildFireMod hibernating...\n");
76 /* Set portE.5 to Digital IO */
77 MCF5282_GPIO_PEPAR &= ~(1 << (5 * 2));
79 /* Make portE.5 an output */
80 MCF5282_GPIO_DDRE |= (1 << 5);
82 /* Now toggle portE.5 from low to high */
83 MCF5282_GPIO_PORTE &= ~(1 << 5);
84 MCF5282_GPIO_PORTE |= (1 << 5);
86 printk(KERN_EMERG "Failed to hibernate. Halting!\n");
90 void __init config_BSP(char *commandp, int size)
92 #ifdef CONFIG_WILDFIRE
93 mach_halt = wildfire_halt;
95 #ifdef CONFIG_WILDFIREMOD
96 mach_halt = wildfiremod_halt;
98 mach_sched_init = hw_timer_init;
101 #ifdef CONFIG_SPI_COLDFIRE_QSPI
106 /***************************************************************************/