2 * Copyright 2012 (C), Jason Cooper <jason@lakedaemon.net>
4 * arch/arm/mach-kirkwood/board-dreamplug.c
6 * Marvell DreamPlug Reference Board Init for drivers not converted to
7 * flattened device tree yet.
9 * This file is licensed under the terms of the GNU General Public
10 * License version 2. This program is licensed "as is" without any
11 * warranty of any kind, whether express or implied.
14 #include <linux/kernel.h>
15 #include <linux/init.h>
16 #include <linux/platform_device.h>
17 #include <linux/mtd/partitions.h>
18 #include <linux/ata_platform.h>
19 #include <linux/mv643xx_eth.h>
21 #include <linux/of_address.h>
22 #include <linux/of_fdt.h>
23 #include <linux/of_irq.h>
24 #include <linux/of_platform.h>
25 #include <linux/gpio.h>
26 #include <linux/leds.h>
27 #include <linux/mtd/physmap.h>
28 #include <linux/spi/flash.h>
29 #include <linux/spi/spi.h>
30 #include <linux/spi/orion_spi.h>
31 #include <asm/mach-types.h>
32 #include <asm/mach/arch.h>
33 #include <asm/mach/map.h>
34 #include <mach/kirkwood.h>
35 #include <mach/bridge-regs.h>
36 #include <plat/mvsdio.h>
40 struct mtd_partition dreamplug_partitions[] = {
49 .offset = SZ_512K + SZ_512K,
54 .offset = SZ_512K + SZ_512K + SZ_512K,
58 static const struct flash_platform_data dreamplug_spi_slave_data = {
61 .parts = dreamplug_partitions,
62 .nr_parts = ARRAY_SIZE(dreamplug_partitions),
65 static struct spi_board_info __initdata dreamplug_spi_slave_info[] = {
68 .platform_data = &dreamplug_spi_slave_data,
70 .max_speed_hz = 50000000,
76 static struct mv643xx_eth_platform_data dreamplug_ge00_data = {
77 .phy_addr = MV643XX_ETH_PHY_ADDR(0),
80 static struct mv643xx_eth_platform_data dreamplug_ge01_data = {
81 .phy_addr = MV643XX_ETH_PHY_ADDR(1),
84 static struct mv_sata_platform_data dreamplug_sata_data = {
88 static struct mvsdio_platform_data dreamplug_mvsdio_data = {
89 /* unfortunately the CD signal has not been connected */
92 static struct gpio_led dreamplug_led_pins[] = {
94 .name = "dreamplug:blue:bluetooth",
99 .name = "dreamplug:green:wifi",
104 .name = "dreamplug:green:wifi_ap",
110 static struct gpio_led_platform_data dreamplug_led_data = {
111 .leds = dreamplug_led_pins,
112 .num_leds = ARRAY_SIZE(dreamplug_led_pins),
115 static struct platform_device dreamplug_leds = {
119 .platform_data = &dreamplug_led_data,
123 static unsigned int dreamplug_mpp_config[] __initdata = {
128 MPP47_GPIO, /* Bluetooth LED */
129 MPP48_GPIO, /* Wifi LED */
130 MPP49_GPIO, /* Wifi AP LED */
134 void __init dreamplug_init(void)
137 * Basic setup. Needs to be called early.
139 kirkwood_mpp_conf(dreamplug_mpp_config);
141 spi_register_board_info(dreamplug_spi_slave_info,
142 ARRAY_SIZE(dreamplug_spi_slave_info));
145 kirkwood_ehci_init();
146 kirkwood_ge00_init(&dreamplug_ge00_data);
147 kirkwood_ge01_init(&dreamplug_ge01_data);
148 kirkwood_sata_init(&dreamplug_sata_data);
149 kirkwood_sdio_init(&dreamplug_mvsdio_data);
151 platform_device_register(&dreamplug_leds);