Merge branch 'core-rcu-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git...
[linux-2.6-block.git] / arch / arm / mach-kirkwood / rd88f6281-setup.c
CommitLineData
651c74c7
SB
1/*
2 * arch/arm/mach-kirkwood/rd88f6281-setup.c
3 *
4 * Marvell RD-88F6281 Reference Board Setup
5 *
6 * This file is licensed under the terms of the GNU General Public
7 * License version 2. This program is licensed "as is" without any
8 * warranty of any kind, whether express or implied.
9 */
10
11#include <linux/kernel.h>
12#include <linux/init.h>
13#include <linux/platform_device.h>
651c74c7 14#include <linux/irq.h>
249cbfa3 15#include <linux/mtd/partitions.h>
651c74c7
SB
16#include <linux/ata_platform.h>
17#include <linux/mv643xx_eth.h>
81600eea 18#include <linux/ethtool.h>
dcf1cece 19#include <net/dsa.h>
651c74c7
SB
20#include <asm/mach-types.h>
21#include <asm/mach/arch.h>
a09e64fb 22#include <mach/kirkwood.h>
c02cecb9 23#include <linux/platform_data/mmc-mvsdio.h>
651c74c7 24#include "common.h"
8235ee00 25#include "mpp.h"
651c74c7
SB
26
27static struct mtd_partition rd88f6281_nand_parts[] = {
28 {
29 .name = "u-boot",
30 .offset = 0,
31 .size = SZ_1M
32 }, {
33 .name = "uImage",
34 .offset = MTDPART_OFS_NXTBLK,
35 .size = SZ_2M
36 }, {
37 .name = "root",
38 .offset = MTDPART_OFS_NXTBLK,
39 .size = MTDPART_SIZ_FULL
40 },
41};
42
651c74c7 43static struct mv643xx_eth_platform_data rd88f6281_ge00_data = {
ac840605 44 .phy_addr = MV643XX_ETH_PHY_NONE,
81600eea
LB
45 .speed = SPEED_1000,
46 .duplex = DUPLEX_FULL,
651c74c7
SB
47};
48
e84665c9 49static struct dsa_chip_data rd88f6281_switch_chip_data = {
dcf1cece
LB
50 .port_names[0] = "lan1",
51 .port_names[1] = "lan2",
52 .port_names[2] = "lan3",
53 .port_names[3] = "lan4",
dcf1cece
LB
54 .port_names[5] = "cpu",
55};
56
e84665c9
LB
57static struct dsa_platform_data rd88f6281_switch_plat_data = {
58 .nr_chips = 1,
59 .chip = &rd88f6281_switch_chip_data,
60};
61
37787e44
RS
62static struct mv643xx_eth_platform_data rd88f6281_ge01_data = {
63 .phy_addr = MV643XX_ETH_PHY_ADDR(11),
64};
65
651c74c7
SB
66static struct mv_sata_platform_data rd88f6281_sata_data = {
67 .n_ports = 2,
68};
69
8235ee00
NP
70static struct mvsdio_platform_data rd88f6281_mvsdio_data = {
71 .gpio_card_detect = 28,
0d0644eb 72 .gpio_write_protect = -1,
8235ee00
NP
73};
74
75static unsigned int rd88f6281_mpp_config[] __initdata = {
76 MPP28_GPIO,
77 0
78};
79
651c74c7
SB
80static void __init rd88f6281_init(void)
81{
37787e44
RS
82 u32 dev, rev;
83
651c74c7
SB
84 /*
85 * Basic setup. Needs to be called early.
86 */
87 kirkwood_init();
8235ee00 88 kirkwood_mpp_conf(rd88f6281_mpp_config);
651c74c7 89
fb7b2d3f 90 kirkwood_nand_init(ARRAY_AND_SIZE(rd88f6281_nand_parts), 25);
651c74c7 91 kirkwood_ehci_init();
37787e44 92
651c74c7 93 kirkwood_ge00_init(&rd88f6281_ge00_data);
37787e44
RS
94 kirkwood_pcie_id(&dev, &rev);
95 if (rev == MV88F6281_REV_A0) {
e84665c9 96 rd88f6281_switch_chip_data.sw_addr = 10;
37787e44
RS
97 kirkwood_ge01_init(&rd88f6281_ge01_data);
98 } else {
e84665c9 99 rd88f6281_switch_chip_data.port_names[4] = "wan";
37787e44 100 }
e84665c9 101 kirkwood_ge00_switch_init(&rd88f6281_switch_plat_data, NO_IRQ);
37787e44 102
651c74c7 103 kirkwood_sata_init(&rd88f6281_sata_data);
8235ee00 104 kirkwood_sdio_init(&rd88f6281_mvsdio_data);
651c74c7 105 kirkwood_uart0_init();
651c74c7
SB
106}
107
108static int __init rd88f6281_pci_init(void)
109{
110 if (machine_is_rd88f6281())
ffd58bd2 111 kirkwood_pcie_init(KW_PCIE0);
651c74c7
SB
112
113 return 0;
114}
115subsys_initcall(rd88f6281_pci_init);
116
117MACHINE_START(RD88F6281, "Marvell RD-88F6281 Reference Board")
118 /* Maintainer: Saeed Bishara <saeed@marvell.com> */
1b7bd28c 119 .atag_offset = 0x100,
651c74c7
SB
120 .init_machine = rd88f6281_init,
121 .map_io = kirkwood_map_io,
4ee1f6b5 122 .init_early = kirkwood_init_early,
651c74c7 123 .init_irq = kirkwood_init_irq,
6bb27d73 124 .init_time = kirkwood_timer_init,
cb15dff4 125 .restart = kirkwood_restart,
651c74c7 126MACHINE_END