2 * arch/arm/mach-kirkwood/openrd-setup.c
4 * Marvell OpenRD (Base|Client|Ultimate) Board Setup
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.
11 #include <linux/kernel.h>
12 #include <linux/init.h>
13 #include <linux/platform_device.h>
14 #include <linux/mtd/nand.h>
15 #include <linux/mtd/partitions.h>
16 #include <linux/ata_platform.h>
17 #include <linux/mv643xx_eth.h>
18 #include <linux/i2c.h>
19 #include <asm/mach-types.h>
20 #include <asm/mach/arch.h>
21 #include <mach/kirkwood.h>
22 #include <plat/mvsdio.h>
26 static struct mtd_partition openrd_nand_parts
[] = {
31 .mask_flags
= MTD_WRITEABLE
34 .offset
= MTDPART_OFS_NXTBLK
,
38 .offset
= MTDPART_OFS_NXTBLK
,
39 .size
= MTDPART_SIZ_FULL
43 static struct mv643xx_eth_platform_data openrd_ge00_data
= {
44 .phy_addr
= MV643XX_ETH_PHY_ADDR(8),
47 static struct mv643xx_eth_platform_data openrd_ge01_data
= {
48 .phy_addr
= MV643XX_ETH_PHY_ADDR(24),
51 static struct mv_sata_platform_data openrd_sata_data
= {
55 static struct mvsdio_platform_data openrd_mvsdio_data
= {
56 .gpio_card_detect
= 29, /* MPP29 used as SD card detect */
59 static unsigned int openrd_mpp_config
[] __initdata
= {
64 static struct i2c_board_info i2c_board_info
[] __initdata
= {
66 I2C_BOARD_INFO("cs42l51", 0x4a),
70 static void __init
openrd_init(void)
73 * Basic setup. Needs to be called early.
76 kirkwood_mpp_conf(openrd_mpp_config
);
78 kirkwood_uart0_init();
79 kirkwood_nand_init(ARRAY_AND_SIZE(openrd_nand_parts
), 25);
83 if (machine_is_openrd_ultimate()) {
84 openrd_ge00_data
.phy_addr
= MV643XX_ETH_PHY_ADDR(0);
85 openrd_ge01_data
.phy_addr
= MV643XX_ETH_PHY_ADDR(1);
88 kirkwood_ge00_init(&openrd_ge00_data
);
89 if (!machine_is_openrd_base())
90 kirkwood_ge01_init(&openrd_ge01_data
);
92 kirkwood_sata_init(&openrd_sata_data
);
93 kirkwood_sdio_init(&openrd_mvsdio_data
);
97 if (machine_is_openrd_client()) {
98 i2c_register_board_info(0, i2c_board_info
,
99 ARRAY_SIZE(i2c_board_info
));
100 kirkwood_audio_init();
104 static int __init
openrd_pci_init(void)
106 if (machine_is_openrd_base() ||
107 machine_is_openrd_client() ||
108 machine_is_openrd_ultimate())
109 kirkwood_pcie_init(KW_PCIE0
);
113 subsys_initcall(openrd_pci_init
);
115 #ifdef CONFIG_MACH_OPENRD_BASE
116 MACHINE_START(OPENRD_BASE
, "Marvell OpenRD Base Board")
117 /* Maintainer: Dhaval Vasa <dhaval.vasa@einfochips.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
= openrd_init
,
122 .map_io
= kirkwood_map_io
,
123 .init_irq
= kirkwood_init_irq
,
124 .timer
= &kirkwood_timer
,
128 #ifdef CONFIG_MACH_OPENRD_CLIENT
129 MACHINE_START(OPENRD_CLIENT
, "Marvell OpenRD Client Board")
130 /* Maintainer: Dhaval Vasa <dhaval.vasa@einfochips.com> */
131 .phys_io
= KIRKWOOD_REGS_PHYS_BASE
,
132 .io_pg_offst
= ((KIRKWOOD_REGS_VIRT_BASE
) >> 18) & 0xfffc,
133 .boot_params
= 0x00000100,
134 .init_machine
= openrd_init
,
135 .map_io
= kirkwood_map_io
,
136 .init_irq
= kirkwood_init_irq
,
137 .timer
= &kirkwood_timer
,
141 #ifdef CONFIG_MACH_OPENRD_ULTIMATE
142 MACHINE_START(OPENRD_ULTIMATE
, "Marvell OpenRD Ultimate Board")
143 /* Maintainer: Dhaval Vasa <dhaval.vasa@einfochips.com> */
144 .phys_io
= KIRKWOOD_REGS_PHYS_BASE
,
145 .io_pg_offst
= ((KIRKWOOD_REGS_VIRT_BASE
) >> 18) & 0xfffc,
146 .boot_params
= 0x00000100,
147 .init_machine
= openrd_init
,
148 .map_io
= kirkwood_map_io
,
149 .init_irq
= kirkwood_init_irq
,
150 .timer
= &kirkwood_timer
,