/arch/arm/mach-kirkwood/rd88f6281-setup.c
C | 125 lines | 95 code | 17 blank | 13 comment | 4 complexity | 571ca44835377450210e30a48754b5d8 MD5 | raw file
Possible License(s): GPL-2.0, LGPL-2.0, AGPL-1.0
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>
14#include <linux/irq.h>
15#include <linux/mtd/partitions.h>
16#include <linux/ata_platform.h>
17#include <linux/mv643xx_eth.h>
18#include <linux/ethtool.h>
19#include <net/dsa.h>
20#include <asm/mach-types.h>
21#include <asm/mach/arch.h>
22#include <mach/kirkwood.h>
23#include <plat/mvsdio.h>
24#include "common.h"
25#include "mpp.h"
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
43static struct mv643xx_eth_platform_data rd88f6281_ge00_data = {
44 .phy_addr = MV643XX_ETH_PHY_NONE,
45 .speed = SPEED_1000,
46 .duplex = DUPLEX_FULL,
47};
48
49static struct dsa_chip_data rd88f6281_switch_chip_data = {
50 .port_names[0] = "lan1",
51 .port_names[1] = "lan2",
52 .port_names[2] = "lan3",
53 .port_names[3] = "lan4",
54 .port_names[5] = "cpu",
55};
56
57static struct dsa_platform_data rd88f6281_switch_plat_data = {
58 .nr_chips = 1,
59 .chip = &rd88f6281_switch_chip_data,
60};
61
62static struct mv643xx_eth_platform_data rd88f6281_ge01_data = {
63 .phy_addr = MV643XX_ETH_PHY_ADDR(11),
64};
65
66static struct mv_sata_platform_data rd88f6281_sata_data = {
67 .n_ports = 2,
68};
69
70static struct mvsdio_platform_data rd88f6281_mvsdio_data = {
71 .gpio_card_detect = 28,
72};
73
74static unsigned int rd88f6281_mpp_config[] __initdata = {
75 MPP28_GPIO,
76 0
77};
78
79static void __init rd88f6281_init(void)
80{
81 u32 dev, rev;
82
83 /*
84 * Basic setup. Needs to be called early.
85 */
86 kirkwood_init();
87 kirkwood_mpp_conf(rd88f6281_mpp_config);
88
89 kirkwood_nand_init(ARRAY_AND_SIZE(rd88f6281_nand_parts), 25);
90 kirkwood_ehci_init();
91
92 kirkwood_ge00_init(&rd88f6281_ge00_data);
93 kirkwood_pcie_id(&dev, &rev);
94 if (rev == MV88F6281_REV_A0) {
95 rd88f6281_switch_chip_data.sw_addr = 10;
96 kirkwood_ge01_init(&rd88f6281_ge01_data);
97 } else {
98 rd88f6281_switch_chip_data.port_names[4] = "wan";
99 }
100 kirkwood_ge00_switch_init(&rd88f6281_switch_plat_data, NO_IRQ);
101
102 kirkwood_sata_init(&rd88f6281_sata_data);
103 kirkwood_sdio_init(&rd88f6281_mvsdio_data);
104 kirkwood_uart0_init();
105}
106
107static int __init rd88f6281_pci_init(void)
108{
109 if (machine_is_rd88f6281())
110 kirkwood_pcie_init();
111
112 return 0;
113}
114subsys_initcall(rd88f6281_pci_init);
115
116MACHINE_START(RD88F6281, "Marvell RD-88F6281 Reference Board")
117 /* Maintainer: Saeed Bishara <saeed@marvell.com> */
118 .phys_io = KIRKWOOD_REGS_PHYS_BASE,
119 .io_pg_offst = ((KIRKWOOD_REGS_VIRT_BASE) >> 18) & 0xfffc,
120 .boot_params = 0x00000100,
121 .init_machine = rd88f6281_init,
122 .map_io = kirkwood_map_io,
123 .init_irq = kirkwood_init_irq,
124 .timer = &kirkwood_timer,
125MACHINE_END