~ubuntu-branches/debian/wheezy/linux-2.6/wheezy

« back to all changes in this revision

Viewing changes to arch/m68k/platform/5272/config.c

  • Committer: Bazaar Package Importer
  • Author(s): Ben Hutchings, Ben Hutchings, Aurelien Jarno
  • Date: 2011-06-07 12:14:05 UTC
  • mfrom: (43.1.9 sid)
  • Revision ID: james.westby@ubuntu.com-20110607121405-i3h1rd7nrnd2b73h
Tags: 2.6.39-2
[ Ben Hutchings ]
* [x86] Enable BACKLIGHT_APPLE, replacing BACKLIGHT_MBP_NVIDIA
  (Closes: #627492)
* cgroups: Disable memory resource controller by default. Allow it
  to be enabled using kernel parameter 'cgroup_enable=memory'.
* rt2800usb: Enable support for more USB devices including
  Linksys WUSB600N (Closes: #596626) (this change was accidentally
  omitted from 2.6.39-1)
* [x86] Remove Celeron from list of processors supporting PAE. Most
  'Celeron M' models do not.
* Update debconf template translations:
  - Swedish (Martin Bagge) (Closes: #628932)
  - French (David Prévot) (Closes: #628191)
* aufs: Update for 2.6.39 (Closes: #627837)
* Add stable 2.6.39.1, including:
  - ext4: dont set PageUptodate in ext4_end_bio()
  - pata_cmd64x: fix boot crash on parisc (Closes: #622997, #622745)
  - ext3: Fix fs corruption when make_indexed_dir() fails
  - netfilter: nf_ct_sip: validate Content-Length in TCP SIP messages
  - sctp: fix race between sctp_bind_addr_free() and
    sctp_bind_addr_conflict()
  - sctp: fix memory leak of the ASCONF queue when free asoc
  - md/bitmap: fix saving of events_cleared and other state
  - cdc_acm: Fix oops when Droids MuIn LCD is connected
  - cx88: Fix conversion from BKL to fine-grained locks (Closes: #619827)
  - keys: Set cred->user_ns in key_replace_session_keyring (CVE-2011-2184)
  - tmpfs: fix race between truncate and writepage
  - nfs41: Correct offset for LAYOUTCOMMIT
  - xen/mmu: fix a race window causing leave_mm BUG()
  - ext4: fix possible use-after-free in ext4_remove_li_request()
  For the complete list of changes, see:
   http://www.kernel.org/pub/linux/kernel/v2.6/ChangeLog-2.6.39.1
* Bump ABI to 2
* netfilter: Enable IP_SET, IP_SET_BITMAP_IP, IP_SET_BITMAP_IPMAC,
  IP_SET_BITMAP_PORT, IP_SET_HASH_IP, IP_SET_HASH_IPPORT,
  IP_SET_HASH_IPPORTIP, IP_SET_HASH_IPPORTNET, IP_SET_HASH_NET,
  IP_SET_HASH_NETPORT, IP_SET_LIST_SET, NETFILTER_XT_SET as modules
  (Closes: #629401)

[ Aurelien Jarno ]
* [mipsel/loongson-2f] Disable_SCSI_LPFC to workaround GCC ICE.

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
/***************************************************************************/
 
2
 
 
3
/*
 
4
 *      linux/arch/m68knommu/platform/5272/config.c
 
5
 *
 
6
 *      Copyright (C) 1999-2002, Greg Ungerer (gerg@snapgear.com)
 
7
 *      Copyright (C) 2001-2002, SnapGear Inc. (www.snapgear.com)
 
8
 */
 
9
 
 
10
/***************************************************************************/
 
11
 
 
12
#include <linux/kernel.h>
 
13
#include <linux/param.h>
 
14
#include <linux/init.h>
 
15
#include <linux/io.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
 
 
23
/***************************************************************************/
 
24
 
 
25
/*
 
26
 *      Some platforms need software versions of the GPIO data registers.
 
27
 */
 
28
unsigned short ppdata;
 
29
unsigned char ledbank = 0xff;
 
30
 
 
31
/***************************************************************************/
 
32
 
 
33
static struct mcf_platform_uart m5272_uart_platform[] = {
 
34
        {
 
35
                .mapbase        = MCF_MBAR + MCFUART_BASE1,
 
36
                .irq            = MCF_IRQ_UART1,
 
37
        },
 
38
        {
 
39
                .mapbase        = MCF_MBAR + MCFUART_BASE2,
 
40
                .irq            = MCF_IRQ_UART2,
 
41
        },
 
42
        { },
 
43
};
 
44
 
 
45
static struct platform_device m5272_uart = {
 
46
        .name                   = "mcfuart",
 
47
        .id                     = 0,
 
48
        .dev.platform_data      = m5272_uart_platform,
 
49
};
 
50
 
 
51
static struct resource m5272_fec_resources[] = {
 
52
        {
 
53
                .start          = MCF_MBAR + 0x840,
 
54
                .end            = MCF_MBAR + 0x840 + 0x1cf,
 
55
                .flags          = IORESOURCE_MEM,
 
56
        },
 
57
        {
 
58
                .start          = MCF_IRQ_ERX,
 
59
                .end            = MCF_IRQ_ERX,
 
60
                .flags          = IORESOURCE_IRQ,
 
61
        },
 
62
        {
 
63
                .start          = MCF_IRQ_ETX,
 
64
                .end            = MCF_IRQ_ETX,
 
65
                .flags          = IORESOURCE_IRQ,
 
66
        },
 
67
        {
 
68
                .start          = MCF_IRQ_ENTC,
 
69
                .end            = MCF_IRQ_ENTC,
 
70
                .flags          = IORESOURCE_IRQ,
 
71
        },
 
72
};
 
73
 
 
74
static struct platform_device m5272_fec = {
 
75
        .name                   = "fec",
 
76
        .id                     = 0,
 
77
        .num_resources          = ARRAY_SIZE(m5272_fec_resources),
 
78
        .resource               = m5272_fec_resources,
 
79
};
 
80
 
 
81
static struct platform_device *m5272_devices[] __initdata = {
 
82
        &m5272_uart,
 
83
        &m5272_fec,
 
84
};
 
85
 
 
86
/***************************************************************************/
 
87
 
 
88
static void __init m5272_uart_init_line(int line, int irq)
 
89
{
 
90
        u32 v;
 
91
 
 
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);
 
97
 
 
98
                v = readl(MCF_MBAR + MCFSIM_PDCNT);
 
99
                v = (v & ~0x000003fc) | 0x000002a8;
 
100
                writel(v, MCF_MBAR + MCFSIM_PDCNT);
 
101
        }
 
102
}
 
103
 
 
104
static void __init m5272_uarts_init(void)
 
105
{
 
106
        const int nrlines = ARRAY_SIZE(m5272_uart_platform);
 
107
        int line;
 
108
 
 
109
        for (line = 0; (line < nrlines); line++)
 
110
                m5272_uart_init_line(line, m5272_uart_platform[line].irq);
 
111
}
 
112
 
 
113
/***************************************************************************/
 
114
 
 
115
static void m5272_cpu_reset(void)
 
116
{
 
117
        local_irq_disable();
 
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);
 
122
        for (;;)
 
123
                /* wait for watchdog to timeout */;
 
124
}
 
125
 
 
126
/***************************************************************************/
 
127
 
 
128
void __init config_BSP(char *commandp, int size)
 
129
{
 
130
#if defined (CONFIG_MOD5272)
 
131
        volatile unsigned char  *pivrp;
 
132
 
 
133
        /* Set base of device vectors to be 64 */
 
134
        pivrp = (volatile unsigned char *) (MCF_MBAR + MCFSIM_PIVR);
 
135
        *pivrp = 0x40;
 
136
#endif
 
137
 
 
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;
 
146
#endif
 
147
 
 
148
        mach_reset = m5272_cpu_reset;
 
149
}
 
150
 
 
151
/***************************************************************************/
 
152
 
 
153
/*
 
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.
 
157
 */
 
158
static struct fixed_phy_status nettel_fixed_phy_status __initdata = {
 
159
        .link   = 1,
 
160
        .speed  = 100,
 
161
        .duplex = 0,
 
162
};
 
163
 
 
164
/***************************************************************************/
 
165
 
 
166
static int __init init_BSP(void)
 
167
{
 
168
        m5272_uarts_init();
 
169
        fixed_phy_add(PHY_POLL, 0, &nettel_fixed_phy_status);
 
170
        platform_add_devices(m5272_devices, ARRAY_SIZE(m5272_devices));
 
171
        return 0;
 
172
}
 
173
 
 
174
arch_initcall(init_BSP);
 
175
 
 
176
/***************************************************************************/