2 * arch/arm/mach-kirkwood/goflexnet-setup.c
4 * Seagate GoFlex Net 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/ata_platform.h>
15 #include <linux/mtd/partitions.h>
16 #include <linux/mv643xx_eth.h>
17 #include <linux/gpio.h>
18 #include <linux/leds.h>
19 #include <asm/mach-types.h>
20 #include <asm/mach/arch.h>
21 #include <mach/kirkwood.h>
25 static struct mtd_partition goflexnet_nand_parts[] = {
32 .offset = MTDPART_OFS_NXTBLK,
36 .offset = MTDPART_OFS_NXTBLK,
40 .offset = MTDPART_OFS_NXTBLK,
41 .size = MTDPART_SIZ_FULL
45 static struct mv643xx_eth_platform_data goflexnet_ge00_data = {
46 .phy_addr = MV643XX_ETH_PHY_ADDR(0),
49 static struct mv_sata_platform_data goflexnet_sata_data = {
53 static struct gpio_led goflexnet_led_pins[] = {
55 .name = "status:green:health",
56 .default_trigger = "default-on",
61 .name = "status:orange:fault",
62 .default_trigger = "none",
67 .name = "status:white:left0",
68 .default_trigger = "none",
73 .name = "status:white:left1",
74 .default_trigger = "none",
79 .name = "status:white:left2",
80 .default_trigger = "none",
85 .name = "status:white:left3",
86 .default_trigger = "none",
91 .name = "status:white:right0",
92 .default_trigger = "none",
97 .name = "status:white:right1",
98 .default_trigger = "none",
103 .name = "status:white:right2",
104 .default_trigger = "none",
105 .gpio = 40, // 0x0100
109 .name = "status:white:right3",
110 .default_trigger = "none",
111 .gpio = 41, // 0x0200
116 static struct gpio_led_platform_data goflexnet_led_data = {
117 .leds = goflexnet_led_pins,
118 .num_leds = ARRAY_SIZE(goflexnet_led_pins),
121 static struct platform_device goflexnet_leds = {
125 .platform_data = &goflexnet_led_data,
129 static unsigned int goflexnet_mpp_config[] __initdata = {
130 MPP29_GPIO, /* USB Power Enable */
131 MPP47_GPIO, /* LED Orange */
132 MPP46_GPIO, /* LED Green */
133 MPP45_GPIO, /* LED Left Capacity 3 */
134 MPP44_GPIO, /* LED Left Capacity 2 */
135 MPP43_GPIO, /* LED Left Capacity 1 */
136 MPP42_GPIO, /* LED Left Capacity 0 */
137 MPP41_GPIO, /* LED Right Capacity 3 */
138 MPP40_GPIO, /* LED Right Capacity 2 */
139 MPP39_GPIO, /* LED Right Capacity 1 */
140 MPP38_GPIO, /* LED Right Capacity 0 */
144 static void __init goflexnet_init(void)
147 * Basic setup. Needs to be called early.
151 /* setup gpio pin select */
152 kirkwood_mpp_conf(goflexnet_mpp_config);
154 kirkwood_uart0_init();
155 kirkwood_nand_init(ARRAY_AND_SIZE(goflexnet_nand_parts), 40);
157 if (gpio_request(29, "USB Power Enable") != 0 ||
158 gpio_direction_output(29, 1) != 0)
159 printk(KERN_ERR "can't set up GPIO 29 (USB Power Enable)\n");
160 kirkwood_ehci_init();
161 kirkwood_ge00_init(&goflexnet_ge00_data);
162 kirkwood_sata_init(&goflexnet_sata_data);
164 platform_device_register(&goflexnet_leds);
167 MACHINE_START(GOFLEXNET, "Seagate GoFlex Net")
168 /* Maintainer: Peter Carmichael <peterjncarm@ovi.com> */
169 .atag_offset = 0x100,
170 .init_machine = goflexnet_init,
171 .map_io = kirkwood_map_io,
172 .init_early = kirkwood_init_early,
173 .init_irq = kirkwood_init_irq,
174 .timer = &kirkwood_timer,
175 .restart = kirkwood_restart,