diff options
Diffstat (limited to 'arch/arm/mach-kirkwood/board-dt.c')
-rw-r--r-- | arch/arm/mach-kirkwood/board-dt.c | 151 |
1 files changed, 23 insertions, 128 deletions
diff --git a/arch/arm/mach-kirkwood/board-dt.c b/arch/arm/mach-kirkwood/board-dt.c index fbe6405602ed..1c672d9e6656 100644 --- a/arch/arm/mach-kirkwood/board-dt.c +++ b/arch/arm/mach-kirkwood/board-dt.c | |||
@@ -3,7 +3,7 @@ | |||
3 | * | 3 | * |
4 | * arch/arm/mach-kirkwood/board-dt.c | 4 | * arch/arm/mach-kirkwood/board-dt.c |
5 | * | 5 | * |
6 | * Marvell DreamPlug Reference Board Setup | 6 | * Flattened Device Tree board initialization |
7 | * | 7 | * |
8 | * This file is licensed under the terms of the GNU General Public | 8 | * This file is licensed under the terms of the GNU General Public |
9 | * License version 2. This program is licensed "as is" without any | 9 | * License version 2. This program is licensed "as is" without any |
@@ -12,150 +12,45 @@ | |||
12 | 12 | ||
13 | #include <linux/kernel.h> | 13 | #include <linux/kernel.h> |
14 | #include <linux/init.h> | 14 | #include <linux/init.h> |
15 | #include <linux/platform_device.h> | ||
16 | #include <linux/mtd/partitions.h> | ||
17 | #include <linux/ata_platform.h> | ||
18 | #include <linux/mv643xx_eth.h> | ||
19 | #include <linux/of.h> | 15 | #include <linux/of.h> |
20 | #include <linux/of_address.h> | ||
21 | #include <linux/of_fdt.h> | ||
22 | #include <linux/of_irq.h> | ||
23 | #include <linux/of_platform.h> | 16 | #include <linux/of_platform.h> |
24 | #include <linux/gpio.h> | ||
25 | #include <linux/leds.h> | ||
26 | #include <linux/mtd/physmap.h> | ||
27 | #include <linux/spi/flash.h> | ||
28 | #include <linux/spi/spi.h> | ||
29 | #include <linux/spi/orion_spi.h> | ||
30 | #include <asm/mach-types.h> | ||
31 | #include <asm/mach/arch.h> | 17 | #include <asm/mach/arch.h> |
32 | #include <mach/kirkwood.h> | 18 | #include <asm/mach/map.h> |
33 | #include <plat/mvsdio.h> | 19 | #include <mach/bridge-regs.h> |
34 | #include "common.h" | 20 | #include "common.h" |
35 | #include "mpp.h" | ||
36 | 21 | ||
37 | static struct of_device_id kirkwood_dt_match_table[] __initdata = { | 22 | static struct of_device_id kirkwood_dt_match_table[] __initdata = { |
38 | { .compatible = "simple-bus", }, | 23 | { .compatible = "simple-bus", }, |
39 | { } | 24 | { } |
40 | }; | 25 | }; |
41 | 26 | ||
42 | struct mtd_partition dreamplug_partitions[] = { | 27 | static void __init kirkwood_dt_init(void) |
43 | { | ||
44 | .name = "u-boot", | ||
45 | .size = SZ_512K, | ||
46 | .offset = 0, | ||
47 | }, | ||
48 | { | ||
49 | .name = "u-boot env", | ||
50 | .size = SZ_64K, | ||
51 | .offset = SZ_512K + SZ_512K, | ||
52 | }, | ||
53 | { | ||
54 | .name = "dtb", | ||
55 | .size = SZ_64K, | ||
56 | .offset = SZ_512K + SZ_512K + SZ_512K, | ||
57 | }, | ||
58 | }; | ||
59 | |||
60 | static const struct flash_platform_data dreamplug_spi_slave_data = { | ||
61 | .type = "mx25l1606e", | ||
62 | .name = "spi_flash", | ||
63 | .parts = dreamplug_partitions, | ||
64 | .nr_parts = ARRAY_SIZE(dreamplug_partitions), | ||
65 | }; | ||
66 | |||
67 | static struct spi_board_info __initdata dreamplug_spi_slave_info[] = { | ||
68 | { | ||
69 | .modalias = "m25p80", | ||
70 | .platform_data = &dreamplug_spi_slave_data, | ||
71 | .irq = -1, | ||
72 | .max_speed_hz = 50000000, | ||
73 | .bus_num = 0, | ||
74 | .chip_select = 0, | ||
75 | }, | ||
76 | }; | ||
77 | |||
78 | static struct mv643xx_eth_platform_data dreamplug_ge00_data = { | ||
79 | .phy_addr = MV643XX_ETH_PHY_ADDR(0), | ||
80 | }; | ||
81 | |||
82 | static struct mv643xx_eth_platform_data dreamplug_ge01_data = { | ||
83 | .phy_addr = MV643XX_ETH_PHY_ADDR(1), | ||
84 | }; | ||
85 | |||
86 | static struct mv_sata_platform_data dreamplug_sata_data = { | ||
87 | .n_ports = 1, | ||
88 | }; | ||
89 | |||
90 | static struct mvsdio_platform_data dreamplug_mvsdio_data = { | ||
91 | /* unfortunately the CD signal has not been connected */ | ||
92 | }; | ||
93 | |||
94 | static struct gpio_led dreamplug_led_pins[] = { | ||
95 | { | ||
96 | .name = "dreamplug:blue:bluetooth", | ||
97 | .gpio = 47, | ||
98 | .active_low = 1, | ||
99 | }, | ||
100 | { | ||
101 | .name = "dreamplug:green:wifi", | ||
102 | .gpio = 48, | ||
103 | .active_low = 1, | ||
104 | }, | ||
105 | { | ||
106 | .name = "dreamplug:green:wifi_ap", | ||
107 | .gpio = 49, | ||
108 | .active_low = 1, | ||
109 | }, | ||
110 | }; | ||
111 | |||
112 | static struct gpio_led_platform_data dreamplug_led_data = { | ||
113 | .leds = dreamplug_led_pins, | ||
114 | .num_leds = ARRAY_SIZE(dreamplug_led_pins), | ||
115 | }; | ||
116 | |||
117 | static struct platform_device dreamplug_leds = { | ||
118 | .name = "leds-gpio", | ||
119 | .id = -1, | ||
120 | .dev = { | ||
121 | .platform_data = &dreamplug_led_data, | ||
122 | } | ||
123 | }; | ||
124 | |||
125 | static unsigned int dreamplug_mpp_config[] __initdata = { | ||
126 | MPP0_SPI_SCn, | ||
127 | MPP1_SPI_MOSI, | ||
128 | MPP2_SPI_SCK, | ||
129 | MPP3_SPI_MISO, | ||
130 | MPP47_GPIO, /* Bluetooth LED */ | ||
131 | MPP48_GPIO, /* Wifi LED */ | ||
132 | MPP49_GPIO, /* Wifi AP LED */ | ||
133 | 0 | ||
134 | }; | ||
135 | |||
136 | static void __init dreamplug_init(void) | ||
137 | { | 28 | { |
29 | pr_info("Kirkwood: %s, TCLK=%d.\n", kirkwood_id(), kirkwood_tclk); | ||
30 | |||
138 | /* | 31 | /* |
139 | * Basic setup. Needs to be called early. | 32 | * Disable propagation of mbus errors to the CPU local bus, |
33 | * as this causes mbus errors (which can occur for example | ||
34 | * for PCI aborts) to throw CPU aborts, which we're not set | ||
35 | * up to deal with. | ||
140 | */ | 36 | */ |
141 | kirkwood_mpp_conf(dreamplug_mpp_config); | 37 | writel(readl(CPU_CONFIG) & ~CPU_CONFIG_ERROR_PROP, CPU_CONFIG); |
142 | 38 | ||
143 | spi_register_board_info(dreamplug_spi_slave_info, | 39 | kirkwood_setup_cpu_mbus(); |
144 | ARRAY_SIZE(dreamplug_spi_slave_info)); | ||
145 | kirkwood_spi_init(); | ||
146 | 40 | ||
147 | kirkwood_ehci_init(); | 41 | #ifdef CONFIG_CACHE_FEROCEON_L2 |
148 | kirkwood_ge00_init(&dreamplug_ge00_data); | 42 | kirkwood_l2_init(); |
149 | kirkwood_ge01_init(&dreamplug_ge01_data); | 43 | #endif |
150 | kirkwood_sata_init(&dreamplug_sata_data); | ||
151 | kirkwood_sdio_init(&dreamplug_mvsdio_data); | ||
152 | 44 | ||
153 | platform_device_register(&dreamplug_leds); | 45 | /* internal devices that every board has */ |
154 | } | 46 | kirkwood_wdt_init(); |
47 | kirkwood_xor0_init(); | ||
48 | kirkwood_xor1_init(); | ||
49 | kirkwood_crypto_init(); | ||
155 | 50 | ||
156 | static void __init kirkwood_dt_init(void) | 51 | #ifdef CONFIG_KEXEC |
157 | { | 52 | kexec_reinit = kirkwood_enable_pcie; |
158 | kirkwood_init(); | 53 | #endif |
159 | 54 | ||
160 | if (of_machine_is_compatible("globalscale,dreamplug")) | 55 | if (of_machine_is_compatible("globalscale,dreamplug")) |
161 | dreamplug_init(); | 56 | dreamplug_init(); |