2 * arch/arm/mach-kirkwood/goflexhome-setup.c
4 * Seagate GoFlex Home 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 goflexhome_nand_parts
[] = {
32 .offset
= MTDPART_OFS_NXTBLK
,
36 .offset
= MTDPART_OFS_NXTBLK
,
37 .size
= MTDPART_SIZ_FULL
41 static struct mv643xx_eth_platform_data goflexhome_ge00_data
= {
42 .phy_addr
= MV643XX_ETH_PHY_ADDR(0),
45 static struct mv_sata_platform_data goflexhome_sata_data
= {
49 static struct gpio_led goflexhome_led_pins
[] = {
51 .name
= "status:green:health",
52 .default_trigger
= "default-on",
57 .name
= "status:orange:fault",
58 .default_trigger
= "none",
63 .name
= "status:white:misc",
64 .default_trigger
= "none",
70 static struct gpio_led_platform_data goflexhome_led_data
= {
71 .leds
= goflexhome_led_pins
,
72 .num_leds
= ARRAY_SIZE(goflexhome_led_pins
),
75 static struct platform_device goflexhome_leds
= {
79 .platform_data
= &goflexhome_led_data
,
83 static unsigned int goflexhome_mpp_config
[] __initdata
= {
84 MPP29_GPIO
, /* USB Power Enable */
85 MPP47_GPIO
, /* LED Orange */
86 MPP46_GPIO
, /* LED Green */
87 MPP40_GPIO
, /* LED White */
91 static void __init
goflexhome_init(void)
94 * Basic setup. Needs to be called early.
98 /* setup gpio pin select */
99 kirkwood_mpp_conf(goflexhome_mpp_config
);
101 kirkwood_uart0_init();
102 kirkwood_nand_init(ARRAY_AND_SIZE(goflexhome_nand_parts
), 40);
104 if (gpio_request(29, "USB Power Enable") != 0 ||
105 gpio_direction_output(29, 1) != 0)
106 printk(KERN_ERR
"can't set up GPIO 29 (USB Power Enable)\n");
107 kirkwood_ehci_init();
108 kirkwood_ge00_init(&goflexhome_ge00_data
);
109 kirkwood_sata_init(&goflexhome_sata_data
);
111 platform_device_register(&goflexhome_leds
);
114 MACHINE_START(GOFLEXHOME
, "Seagate GoFlex Home")
115 /* Maintainer: Peter Carmichael <peterjncarm@ovi.com> */
116 .atag_offset
= 0x100,
117 .init_machine
= goflexhome_init
,
118 .map_io
= kirkwood_map_io
,
119 .init_early
= kirkwood_init_early
,
120 .init_irq
= kirkwood_init_irq
,
121 .timer
= &kirkwood_timer
,
122 .restart
= kirkwood_restart
,