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 struct mcf_platform_uart m5272_uart_platform[] = {
35
.mapbase = MCF_MBAR + MCFUART_BASE1,
39
.mapbase = MCF_MBAR + MCFUART_BASE2,
45
static struct platform_device m5272_uart = {
48
.dev.platform_data = m5272_uart_platform,
51
static struct resource m5272_fec_resources[] = {
53
.start = MCF_MBAR + 0x840,
54
.end = MCF_MBAR + 0x840 + 0x1cf,
55
.flags = IORESOURCE_MEM,
60
.flags = IORESOURCE_IRQ,
65
.flags = IORESOURCE_IRQ,
68
.start = MCF_IRQ_ENTC,
70
.flags = IORESOURCE_IRQ,
74
static struct platform_device m5272_fec = {
77
.num_resources = ARRAY_SIZE(m5272_fec_resources),
78
.resource = m5272_fec_resources,
81
static struct platform_device *m5272_devices[] __initdata = {
86
/***************************************************************************/
88
static void __init m5272_uart_init_line(int line, int irq)
92
if ((line >= 0) && (line < 2)) {
93
/* Enable the output lines for the serial ports */
94
v = readl(MCF_MBAR + MCFSIM_PBCNT);
95
v = (v & ~0x000000ff) | 0x00000055;
96
writel(v, MCF_MBAR + MCFSIM_PBCNT);
98
v = readl(MCF_MBAR + MCFSIM_PDCNT);
99
v = (v & ~0x000003fc) | 0x000002a8;
100
writel(v, MCF_MBAR + MCFSIM_PDCNT);
104
static void __init m5272_uarts_init(void)
106
const int nrlines = ARRAY_SIZE(m5272_uart_platform);
109
for (line = 0; (line < nrlines); line++)
110
m5272_uart_init_line(line, m5272_uart_platform[line].irq);
113
/***************************************************************************/
115
static void m5272_cpu_reset(void)
118
/* Set watchdog to reset, and enabled */
119
__raw_writew(0, MCF_MBAR + MCFSIM_WIRR);
120
__raw_writew(1, MCF_MBAR + MCFSIM_WRRR);
121
__raw_writew(0, MCF_MBAR + MCFSIM_WCR);
123
/* wait for watchdog to timeout */;
126
/***************************************************************************/
128
void __init config_BSP(char *commandp, int size)
130
#if defined (CONFIG_MOD5272)
131
volatile unsigned char *pivrp;
133
/* Set base of device vectors to be 64 */
134
pivrp = (volatile unsigned char *) (MCF_MBAR + MCFSIM_PIVR);
138
#if defined(CONFIG_NETtel) || defined(CONFIG_SCALES)
139
/* Copy command line from FLASH to local buffer... */
140
memcpy(commandp, (char *) 0xf0004000, size);
141
commandp[size-1] = 0;
142
#elif defined(CONFIG_CANCam)
143
/* Copy command line from FLASH to local buffer... */
144
memcpy(commandp, (char *) 0xf0010000, size);
145
commandp[size-1] = 0;
148
mach_reset = m5272_cpu_reset;
151
/***************************************************************************/
154
* Some 5272 based boards have the FEC ethernet diectly connected to
155
* an ethernet switch. In this case we need to use the fixed phy type,
156
* and we need to declare it early in boot.
158
static struct fixed_phy_status nettel_fixed_phy_status __initdata = {
164
/***************************************************************************/
166
static int __init init_BSP(void)
169
fixed_phy_add(PHY_POLL, 0, &nettel_fixed_phy_status);
170
platform_add_devices(m5272_devices, ARRAY_SIZE(m5272_devices));
174
arch_initcall(init_BSP);
176
/***************************************************************************/