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>
22 #include <asm/mcfgpio.h>
24 /***************************************************************************/
27 * Some platforms need software versions of the GPIO data registers.
29 unsigned short ppdata;
30 unsigned char ledbank = 0xff;
32 /***************************************************************************/
34 struct mcf_gpio_chip mcf_gpio_chips[] = {
35 MCFGPS(PA, 0, 16, MCFSIM_PADDR, MCFSIM_PADAT, MCFSIM_PADAT),
36 MCFGPS(PB, 16, 16, MCFSIM_PBDDR, MCFSIM_PBDAT, MCFSIM_PBDAT),
37 MCFGPS(Pc, 32, 16, MCFSIM_PCDDR, MCFSIM_PCDAT, MCFSIM_PCDAT),
40 unsigned int mcf_gpio_chips_size = ARRAY_SIZE(mcf_gpio_chips);
42 /***************************************************************************/
44 static void __init m5272_uarts_init(void)
48 /* Enable the output lines for the serial ports */
49 v = readl(MCF_MBAR + MCFSIM_PBCNT);
50 v = (v & ~0x000000ff) | 0x00000055;
51 writel(v, MCF_MBAR + MCFSIM_PBCNT);
53 v = readl(MCF_MBAR + MCFSIM_PDCNT);
54 v = (v & ~0x000003fc) | 0x000002a8;
55 writel(v, MCF_MBAR + MCFSIM_PDCNT);
58 /***************************************************************************/
60 static void m5272_cpu_reset(void)
63 /* Set watchdog to reset, and enabled */
64 __raw_writew(0, MCF_MBAR + MCFSIM_WIRR);
65 __raw_writew(1, MCF_MBAR + MCFSIM_WRRR);
66 __raw_writew(0, MCF_MBAR + MCFSIM_WCR);
68 /* wait for watchdog to timeout */;
71 /***************************************************************************/
73 void __init config_BSP(char *commandp, int size)
75 #if defined (CONFIG_MOD5272)
76 volatile unsigned char *pivrp;
78 /* Set base of device vectors to be 64 */
79 pivrp = (volatile unsigned char *) (MCF_MBAR + MCFSIM_PIVR);
83 #if defined(CONFIG_NETtel) || defined(CONFIG_SCALES)
84 /* Copy command line from FLASH to local buffer... */
85 memcpy(commandp, (char *) 0xf0004000, size);
87 #elif defined(CONFIG_CANCam)
88 /* Copy command line from FLASH to local buffer... */
89 memcpy(commandp, (char *) 0xf0010000, size);
93 mach_reset = m5272_cpu_reset;
94 mach_sched_init = hw_timer_init;
97 /***************************************************************************/
100 * Some 5272 based boards have the FEC ethernet diectly connected to
101 * an ethernet switch. In this case we need to use the fixed phy type,
102 * and we need to declare it early in boot.
104 static struct fixed_phy_status nettel_fixed_phy_status __initdata = {
110 /***************************************************************************/
112 static int __init init_BSP(void)
115 fixed_phy_add(PHY_POLL, 0, &nettel_fixed_phy_status);
119 arch_initcall(init_BSP);
121 /***************************************************************************/