diff options
author | Simon Guinot <sguinot@lacie.com> | 2010-09-19 09:33:59 -0400 |
---|---|---|
committer | Nicolas Pitre <nico@fluxnic.net> | 2010-09-19 22:43:45 -0400 |
commit | b51d92da4ebb52b61fdc99c911171562673e88ef (patch) | |
tree | 09b08f200c2d7dceabb050780783b654748e312b /arch/arm/mach-kirkwood/d2net_v2-setup.c | |
parent | 84712e9aa43862ded44e47acfaa93612a7eeaf7c (diff) |
[ARM] Kirkwood: remove duplicated code in LaCie setup files
Signed-off-by: Simon Guinot <sguinot@lacie.com>
Signed-off-by: Nicolas Pitre <nico@fluxnic.net>
Diffstat (limited to 'arch/arm/mach-kirkwood/d2net_v2-setup.c')
-rw-r--r-- | arch/arm/mach-kirkwood/d2net_v2-setup.c | 102 |
1 files changed, 5 insertions, 97 deletions
diff --git a/arch/arm/mach-kirkwood/d2net_v2-setup.c b/arch/arm/mach-kirkwood/d2net_v2-setup.c index 310c6a0331f6..cd62d0f82a73 100644 --- a/arch/arm/mach-kirkwood/d2net_v2-setup.c +++ b/arch/arm/mach-kirkwood/d2net_v2-setup.c | |||
@@ -23,56 +23,19 @@ | |||
23 | #include <linux/kernel.h> | 23 | #include <linux/kernel.h> |
24 | #include <linux/init.h> | 24 | #include <linux/init.h> |
25 | #include <linux/platform_device.h> | 25 | #include <linux/platform_device.h> |
26 | #include <linux/mtd/physmap.h> | ||
27 | #include <linux/spi/flash.h> | ||
28 | #include <linux/spi/spi.h> | ||
29 | #include <linux/ata_platform.h> | 26 | #include <linux/ata_platform.h> |
30 | #include <linux/mv643xx_eth.h> | 27 | #include <linux/mv643xx_eth.h> |
31 | #include <linux/i2c.h> | ||
32 | #include <linux/i2c/at24.h> | ||
33 | #include <linux/input.h> | 28 | #include <linux/input.h> |
34 | #include <linux/gpio.h> | 29 | #include <linux/gpio.h> |
35 | #include <linux/gpio_keys.h> | 30 | #include <linux/gpio_keys.h> |
36 | #include <linux/leds.h> | 31 | #include <linux/leds.h> |
37 | #include <asm/mach-types.h> | 32 | #include <asm/mach-types.h> |
38 | #include <asm/mach/arch.h> | 33 | #include <asm/mach/arch.h> |
39 | #include <asm/mach/time.h> | ||
40 | #include <mach/kirkwood.h> | 34 | #include <mach/kirkwood.h> |
41 | #include <mach/leds-ns2.h> | 35 | #include <mach/leds-ns2.h> |
42 | #include <plat/time.h> | ||
43 | #include "common.h" | 36 | #include "common.h" |
44 | #include "mpp.h" | 37 | #include "mpp.h" |
45 | 38 | #include "lacie_v2-common.h" | |
46 | /***************************************************************************** | ||
47 | * 512KB SPI Flash on Boot Device | ||
48 | ****************************************************************************/ | ||
49 | |||
50 | static struct mtd_partition d2net_v2_flash_parts[] = { | ||
51 | { | ||
52 | .name = "u-boot", | ||
53 | .size = MTDPART_SIZ_FULL, | ||
54 | .offset = 0, | ||
55 | .mask_flags = MTD_WRITEABLE, | ||
56 | }, | ||
57 | }; | ||
58 | |||
59 | static const struct flash_platform_data d2net_v2_flash = { | ||
60 | .type = "mx25l4005a", | ||
61 | .name = "spi_flash", | ||
62 | .parts = d2net_v2_flash_parts, | ||
63 | .nr_parts = ARRAY_SIZE(d2net_v2_flash_parts), | ||
64 | }; | ||
65 | |||
66 | static struct spi_board_info __initdata d2net_v2_spi_slave_info[] = { | ||
67 | { | ||
68 | .modalias = "m25p80", | ||
69 | .platform_data = &d2net_v2_flash, | ||
70 | .irq = -1, | ||
71 | .max_speed_hz = 20000000, | ||
72 | .bus_num = 0, | ||
73 | .chip_select = 0, | ||
74 | }, | ||
75 | }; | ||
76 | 39 | ||
77 | /***************************************************************************** | 40 | /***************************************************************************** |
78 | * Ethernet | 41 | * Ethernet |
@@ -83,27 +46,6 @@ static struct mv643xx_eth_platform_data d2net_v2_ge00_data = { | |||
83 | }; | 46 | }; |
84 | 47 | ||
85 | /***************************************************************************** | 48 | /***************************************************************************** |
86 | * I2C devices | ||
87 | ****************************************************************************/ | ||
88 | |||
89 | static struct at24_platform_data at24c04 = { | ||
90 | .byte_len = SZ_4K / 8, | ||
91 | .page_size = 16, | ||
92 | }; | ||
93 | |||
94 | /* | ||
95 | * i2c addr | chip | description | ||
96 | * 0x50 | HT24LC04 | eeprom (512B) | ||
97 | */ | ||
98 | |||
99 | static struct i2c_board_info __initdata d2net_v2_i2c_info[] = { | ||
100 | { | ||
101 | I2C_BOARD_INFO("24c04", 0x50), | ||
102 | .platform_data = &at24c04, | ||
103 | } | ||
104 | }; | ||
105 | |||
106 | /***************************************************************************** | ||
107 | * SATA | 49 | * SATA |
108 | ****************************************************************************/ | 50 | ****************************************************************************/ |
109 | 51 | ||
@@ -111,22 +53,6 @@ static struct mv_sata_platform_data d2net_v2_sata_data = { | |||
111 | .n_ports = 2, | 53 | .n_ports = 2, |
112 | }; | 54 | }; |
113 | 55 | ||
114 | #define D2NET_V2_GPIO_SATA0_POWER 16 | ||
115 | |||
116 | static void __init d2net_v2_sata_power_init(void) | ||
117 | { | ||
118 | int err; | ||
119 | |||
120 | err = gpio_request(D2NET_V2_GPIO_SATA0_POWER, "SATA0 power"); | ||
121 | if (err == 0) { | ||
122 | err = gpio_direction_output(D2NET_V2_GPIO_SATA0_POWER, 1); | ||
123 | if (err) | ||
124 | gpio_free(D2NET_V2_GPIO_SATA0_POWER); | ||
125 | } | ||
126 | if (err) | ||
127 | pr_err("d2net_v2: failed to configure SATA0 power GPIO\n"); | ||
128 | } | ||
129 | |||
130 | /***************************************************************************** | 56 | /***************************************************************************** |
131 | * GPIO keys | 57 | * GPIO keys |
132 | ****************************************************************************/ | 58 | ****************************************************************************/ |
@@ -229,20 +155,6 @@ static struct platform_device d2net_v2_leds = { | |||
229 | }; | 155 | }; |
230 | 156 | ||
231 | /***************************************************************************** | 157 | /***************************************************************************** |
232 | * Timer | ||
233 | ****************************************************************************/ | ||
234 | |||
235 | static void d2net_v2_timer_init(void) | ||
236 | { | ||
237 | kirkwood_tclk = 166666667; | ||
238 | orion_time_init(IRQ_KIRKWOOD_BRIDGE, kirkwood_tclk); | ||
239 | } | ||
240 | |||
241 | struct sys_timer d2net_v2_timer = { | ||
242 | .init = d2net_v2_timer_init, | ||
243 | }; | ||
244 | |||
245 | /***************************************************************************** | ||
246 | * General Setup | 158 | * General Setup |
247 | ****************************************************************************/ | 159 | ****************************************************************************/ |
248 | 160 | ||
@@ -288,18 +200,14 @@ static void __init d2net_v2_init(void) | |||
288 | kirkwood_init(); | 200 | kirkwood_init(); |
289 | kirkwood_mpp_conf(d2net_v2_mpp_config); | 201 | kirkwood_mpp_conf(d2net_v2_mpp_config); |
290 | 202 | ||
291 | d2net_v2_sata_power_init(); | 203 | lacie_v2_hdd_power_init(1); |
292 | 204 | ||
293 | kirkwood_ehci_init(); | 205 | kirkwood_ehci_init(); |
294 | kirkwood_ge00_init(&d2net_v2_ge00_data); | 206 | kirkwood_ge00_init(&d2net_v2_ge00_data); |
295 | kirkwood_sata_init(&d2net_v2_sata_data); | 207 | kirkwood_sata_init(&d2net_v2_sata_data); |
296 | kirkwood_uart0_init(); | 208 | kirkwood_uart0_init(); |
297 | spi_register_board_info(d2net_v2_spi_slave_info, | 209 | lacie_v2_register_flash(); |
298 | ARRAY_SIZE(d2net_v2_spi_slave_info)); | 210 | lacie_v2_register_i2c_devices(); |
299 | kirkwood_spi_init(); | ||
300 | kirkwood_i2c_init(); | ||
301 | i2c_register_board_info(0, d2net_v2_i2c_info, | ||
302 | ARRAY_SIZE(d2net_v2_i2c_info)); | ||
303 | 211 | ||
304 | platform_device_register(&d2net_v2_leds); | 212 | platform_device_register(&d2net_v2_leds); |
305 | platform_device_register(&d2net_v2_gpio_leds); | 213 | platform_device_register(&d2net_v2_gpio_leds); |
@@ -319,5 +227,5 @@ MACHINE_START(D2NET_V2, "LaCie d2 Network v2") | |||
319 | .init_machine = d2net_v2_init, | 227 | .init_machine = d2net_v2_init, |
320 | .map_io = kirkwood_map_io, | 228 | .map_io = kirkwood_map_io, |
321 | .init_irq = kirkwood_init_irq, | 229 | .init_irq = kirkwood_init_irq, |
322 | .timer = &d2net_v2_timer, | 230 | .timer = &lacie_v2_timer, |
323 | MACHINE_END | 231 | MACHINE_END |