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>
16 #include <linux/phy.h>
17 #include <linux/phy_fixed.h>
18 #include <asm/machdep.h>
19 #include <asm/coldfire.h>
20 #include <asm/mcfsim.h>
21 #include <asm/mcfuart.h>
23 /***************************************************************************/
26 * Some platforms need software versions of the GPIO data registers.
28 unsigned short ppdata;
29 unsigned char ledbank = 0xff;
31 /***************************************************************************/
33 static void __init m5272_uarts_init(void)
37 /* Enable the output lines for the serial ports */
38 v = readl(MCF_MBAR + MCFSIM_PBCNT);
39 v = (v & ~0x000000ff) | 0x00000055;
40 writel(v, MCF_MBAR + MCFSIM_PBCNT);
42 v = readl(MCF_MBAR + MCFSIM_PDCNT);
43 v = (v & ~0x000003fc) | 0x000002a8;
44 writel(v, MCF_MBAR + MCFSIM_PDCNT);
47 /***************************************************************************/
49 static void m5272_cpu_reset(void)
52 /* Set watchdog to reset, and enabled */
53 __raw_writew(0, MCF_MBAR + MCFSIM_WIRR);
54 __raw_writew(1, MCF_MBAR + MCFSIM_WRRR);
55 __raw_writew(0, MCF_MBAR + MCFSIM_WCR);
57 /* wait for watchdog to timeout */;
60 /***************************************************************************/
62 void __init config_BSP(char *commandp, int size)
64 #if defined (CONFIG_MOD5272)
65 volatile unsigned char *pivrp;
67 /* Set base of device vectors to be 64 */
68 pivrp = (volatile unsigned char *) (MCF_MBAR + MCFSIM_PIVR);
72 #if defined(CONFIG_NETtel) || defined(CONFIG_SCALES)
73 /* Copy command line from FLASH to local buffer... */
74 memcpy(commandp, (char *) 0xf0004000, size);
76 #elif defined(CONFIG_CANCam)
77 /* Copy command line from FLASH to local buffer... */
78 memcpy(commandp, (char *) 0xf0010000, size);
82 mach_reset = m5272_cpu_reset;
83 mach_sched_init = hw_timer_init;
86 /***************************************************************************/
89 * Some 5272 based boards have the FEC ethernet diectly connected to
90 * an ethernet switch. In this case we need to use the fixed phy type,
91 * and we need to declare it early in boot.
93 static struct fixed_phy_status nettel_fixed_phy_status __initdata = {
99 /***************************************************************************/
101 static int __init init_BSP(void)
104 fixed_phy_add(PHY_POLL, 0, &nettel_fixed_phy_status);
108 arch_initcall(init_BSP);
110 /***************************************************************************/