From 9b63dc5b3e497c917c4afed15d8425aa413784e1 Mon Sep 17 00:00:00 2001 From: Peter Carmichael Date: Mon, 7 Feb 2011 00:40:17 +0000 Subject: [PATCH] Support for GoFlex Home under its own ID --- arch/arm/mach-kirkwood/Kconfig | 6 ++ arch/arm/mach-kirkwood/Makefile | 1 + arch/arm/mach-kirkwood/goflexhome-setup.c | 115 +++++++++++++++++++++++++++++ arch/arm/tools/mach-types | 1 + 4 files changed, 123 insertions(+), 0 deletions(-) create mode 100644 arch/arm/mach-kirkwood/goflexhome-setup.c diff --git a/arch/arm/mach-kirkwood/Kconfig b/arch/arm/mach-kirkwood/Kconfig index f17c5d8..dc3cc54 100644 --- a/arch/arm/mach-kirkwood/Kconfig +++ b/arch/arm/mach-kirkwood/Kconfig @@ -70,6 +70,12 @@ config MACH_GOFLEXNET Say 'Y' here if you want your kernel to support the Seagate GoFlex Net. +config MACH_GOFLEXHOME + bool "Seagate GoFlex Home" + help + Say 'Y' here if you want your kernel to support the + Seagate GoFlex Home. + config MACH_OPENRD bool diff --git a/arch/arm/mach-kirkwood/Makefile b/arch/arm/mach-kirkwood/Makefile index 1a15f9f..48951cb 100644 --- a/arch/arm/mach-kirkwood/Makefile +++ b/arch/arm/mach-kirkwood/Makefile @@ -9,6 +9,7 @@ obj-$(CONFIG_MACH_ESATA_SHEEVAPLUG) += sheevaplug-setup.o obj-$(CONFIG_MACH_GURUPLUG) += guruplug-setup.o obj-$(CONFIG_MACH_DOCKSTAR) += dockstar-setup.o obj-$(CONFIG_MACH_GOFLEXNET) += goflexnet-setup.o +obj-$(CONFIG_MACH_GOFLEXHOME) += goflexhome-setup.o obj-$(CONFIG_MACH_TS219) += ts219-setup.o tsx1x-common.o obj-$(CONFIG_MACH_TS41X) += ts41x-setup.o tsx1x-common.o obj-$(CONFIG_MACH_OPENRD) += openrd-setup.o diff --git a/arch/arm/mach-kirkwood/goflexhome-setup.c b/arch/arm/mach-kirkwood/goflexhome-setup.c new file mode 100644 index 0000000..54fe8e3 --- /dev/null +++ b/arch/arm/mach-kirkwood/goflexhome-setup.c @@ -0,0 +1,115 @@ +/* + * arch/arm/mach-kirkwood/goflexhome-setup.c + * + * Seagate GoFlex Home Setup + * + * This file is licensed under the terms of the GNU General Public + * License version 2. This program is licensed "as is" without any + * warranty of any kind, whether express or implied. + */ + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include "common.h" +#include "mpp.h" + +static struct mtd_partition goflexhome_nand_parts[] = { + { + .name = "u-boot", + .offset = 0, + .size = SZ_1M + }, { + .name = "uImage", + .offset = MTDPART_OFS_NXTBLK, + .size = SZ_2M + SZ_4M + }, { + .name = "root", + .offset = MTDPART_OFS_NXTBLK, + .size = MTDPART_SIZ_FULL + }, +}; + +static struct mv643xx_eth_platform_data goflexhome_ge00_data = { + .phy_addr = MV643XX_ETH_PHY_ADDR(0), +}; + +static struct mv_sata_platform_data goflexhome_sata_data = { + .n_ports = 1, +}; + +static struct gpio_led goflexhome_led_pins[] = { + { + .name = "status:green:health", + .default_trigger = "default-on", + .gpio = 46, + .active_low = 1, + }, + { + .name = "status:orange:fault", + .default_trigger = "none", + .gpio = 47, + .active_low = 1, + } +}; + +static struct gpio_led_platform_data goflexhome_led_data = { + .leds = goflexhome_led_pins, + .num_leds = ARRAY_SIZE(goflexhome_led_pins), +}; + +static struct platform_device goflexhome_leds = { + .name = "leds-gpio", + .id = -1, + .dev = { + .platform_data = &goflexhome_led_data, + } +}; + +static unsigned int goflexhome_mpp_config[] __initdata = { + MPP29_GPIO, /* USB Power Enable */ + MPP47_GPIO, /* LED Orange */ + MPP46_GPIO, /* LED Green */ + 0 +}; + +static void __init goflexhome_init(void) +{ + /* + * Basic setup. Needs to be called early. + */ + kirkwood_init(); + + /* setup gpio pin select */ + kirkwood_mpp_conf(goflexhome_mpp_config); + + kirkwood_uart0_init(); + kirkwood_nand_init(ARRAY_AND_SIZE(goflexhome_nand_parts), 25); + + if (gpio_request(29, "USB Power Enable") != 0 || + gpio_direction_output(29, 1) != 0) + printk(KERN_ERR "can't set up GPIO 29 (USB Power Enable)\n"); + kirkwood_ehci_init(); + kirkwood_ge00_init(&goflexhome_ge00_data); + kirkwood_sata_init(&goflexhome_sata_data); + + platform_device_register(&goflexhome_leds); +} + +MACHINE_START(GOFLEXHOME, "Seagate GoFlex Home") + /* Maintainer: Peter Carmichael */ + .boot_params = 0x00000100, + .init_machine = goflexhome_init, + .map_io = kirkwood_map_io, + .init_irq = kirkwood_init_irq, + .timer = &kirkwood_timer, +MACHINE_END + diff --git a/arch/arm/tools/mach-types b/arch/arm/tools/mach-types index 2fea897..8f68f5b 100644 --- a/arch/arm/tools/mach-types +++ b/arch/arm/tools/mach-types @@ -3219,3 +3219,4 @@ pivicc MACH_PIVICC PIVICC 3235 pcm048 MACH_PCM048 PCM048 3236 dds MACH_DDS DDS 3237 chalten_xa1 MACH_CHALTEN_XA1 CHALTEN_XA1 3238 +goflexhome MACH_GOFLEXHOME GOFLEXHOME 3338 -- 1.5.6.5