From d8ecb3490050b33bf46ce77c7f239e0fc51a6835 Mon Sep 17 00:00:00 2001 From: John Holland Date: Fri, 19 Feb 2010 23:10:58 +0100 Subject: [ARM] eSATA SheevaPlug basic board support Allow basic eSATA SheevaPlug board configuration and build. Signed-off-by: John Holland Signed-off-by: Nicolas Pitre -- --- arch/arm/mach-kirkwood/Kconfig | 6 ++++++ arch/arm/mach-kirkwood/Makefile | 1 + arch/arm/mach-kirkwood/sheevaplug-setup.c | 14 ++++++++++++++ 3 files changed, 21 insertions(+) (limited to 'arch/arm/mach-kirkwood') diff --git a/arch/arm/mach-kirkwood/Kconfig b/arch/arm/mach-kirkwood/Kconfig index f6c6196a51fa..1b8addaeb497 100644 --- a/arch/arm/mach-kirkwood/Kconfig +++ b/arch/arm/mach-kirkwood/Kconfig @@ -32,6 +32,12 @@ config MACH_SHEEVAPLUG Say 'Y' here if you want your kernel to support the Marvell SheevaPlug Reference Board. +config MACH_ESATA_SHEEVAPLUG + bool "Marvell eSATA SheevaPlug Reference Board" + help + Say 'Y' here if you want your kernel to support the + Marvell eSATA SheevaPlug Reference Board. + config MACH_TS219 bool "QNAP TS-110, TS-119, TS-210, TS-219 and TS-219P Turbo NAS" help diff --git a/arch/arm/mach-kirkwood/Makefile b/arch/arm/mach-kirkwood/Makefile index d4d7f53b0fb9..704b8927dbb7 100644 --- a/arch/arm/mach-kirkwood/Makefile +++ b/arch/arm/mach-kirkwood/Makefile @@ -5,6 +5,7 @@ obj-$(CONFIG_MACH_RD88F6192_NAS) += rd88f6192-nas-setup.o obj-$(CONFIG_MACH_RD88F6281) += rd88f6281-setup.o obj-$(CONFIG_MACH_MV88F6281GTW_GE) += mv88f6281gtw_ge-setup.o obj-$(CONFIG_MACH_SHEEVAPLUG) += sheevaplug-setup.o +obj-$(CONFIG_MACH_ESATA_SHEEVAPLUG) += sheevaplug-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_BASE) += openrd_base-setup.o diff --git a/arch/arm/mach-kirkwood/sheevaplug-setup.c b/arch/arm/mach-kirkwood/sheevaplug-setup.c index c7319eeac8bb..629ce84ae433 100644 --- a/arch/arm/mach-kirkwood/sheevaplug-setup.c +++ b/arch/arm/mach-kirkwood/sheevaplug-setup.c @@ -96,6 +96,7 @@ static void __init sheevaplug_init(void) platform_device_register(&sheevaplug_leds); } +#ifdef CONFIG_MACH_SHEEVAPLUG MACHINE_START(SHEEVAPLUG, "Marvell SheevaPlug Reference Board") /* Maintainer: shadi Ammouri */ .phys_io = KIRKWOOD_REGS_PHYS_BASE, @@ -106,3 +107,16 @@ MACHINE_START(SHEEVAPLUG, "Marvell SheevaPlug Reference Board") .init_irq = kirkwood_init_irq, .timer = &kirkwood_timer, MACHINE_END +#endif + +#ifdef CONFIG_MACH_ESATA_SHEEVAPLUG +MACHINE_START(ESATA_SHEEVAPLUG, "Marvell eSATA SheevaPlug Reference Board") + .phys_io = KIRKWOOD_REGS_PHYS_BASE, + .io_pg_offst = ((KIRKWOOD_REGS_VIRT_BASE) >> 18) & 0xfffc, + .boot_params = 0x00000100, + .init_machine = sheevaplug_init, + .map_io = kirkwood_map_io, + .init_irq = kirkwood_init_irq, + .timer = &kirkwood_timer, +MACHINE_END +#endif -- cgit v1.2.3 From d7b222d708e6eff0cf47928f439c8bcf49f10bb6 Mon Sep 17 00:00:00 2001 From: John Holland Date: Fri, 19 Feb 2010 23:11:01 +0100 Subject: [ARM] eSATA SheevaPlug: configure SoC SATA interface Enable the kirkwood SATA SoC interface on the eSATA SheevaPlug. Signed-off-by: John Holland Signed-off-by: Nicolas Pitre -- --- arch/arm/mach-kirkwood/sheevaplug-setup.c | 10 ++++++++++ 1 file changed, 10 insertions(+) (limited to 'arch/arm/mach-kirkwood') diff --git a/arch/arm/mach-kirkwood/sheevaplug-setup.c b/arch/arm/mach-kirkwood/sheevaplug-setup.c index 629ce84ae433..bb9bc70381ef 100644 --- a/arch/arm/mach-kirkwood/sheevaplug-setup.c +++ b/arch/arm/mach-kirkwood/sheevaplug-setup.c @@ -11,6 +11,7 @@ #include #include #include +#include #include #include #include @@ -42,6 +43,10 @@ static struct mv643xx_eth_platform_data sheevaplug_ge00_data = { .phy_addr = MV643XX_ETH_PHY_ADDR(0), }; +static struct mv_sata_platform_data sheeva_esata_sata_data = { + .n_ports = 2, +}; + static struct mvsdio_platform_data sheevaplug_mvsdio_data = { /* unfortunately the CD signal has not been connected */ }; @@ -91,6 +96,11 @@ static void __init sheevaplug_init(void) kirkwood_ehci_init(); kirkwood_ge00_init(&sheevaplug_ge00_data); + + /* honor lower power consumption for plugs with out eSATA */ + if (machine_is_sheeva_esata()) + kirkwood_sata_init(&sheeva_esata_sata_data); + kirkwood_sdio_init(&sheevaplug_mvsdio_data); platform_device_register(&sheevaplug_leds); -- cgit v1.2.3 From d5b5746bed1023e4a55f96405422d3e51968fa43 Mon Sep 17 00:00:00 2001 From: John Holland Date: Fri, 19 Feb 2010 23:11:04 +0100 Subject: [ARM] eSATA SheevaPlug: correlate MPP to SD CD and SD WP Accept SD CD and SD WP in accordance to http://plugcomputer.org/data/docs/Sheeva-PowerPlug-V1.3-GTI-090906.pdf on MPP 47 and 44 respectively on the eSATA SheevaPlug Signed-off-by: John Holland Signed-off-by: Nicolas Pitre -- --- arch/arm/mach-kirkwood/sheevaplug-setup.c | 26 ++++++++++++++++++++++++-- 1 file changed, 24 insertions(+), 2 deletions(-) (limited to 'arch/arm/mach-kirkwood') diff --git a/arch/arm/mach-kirkwood/sheevaplug-setup.c b/arch/arm/mach-kirkwood/sheevaplug-setup.c index bb9bc70381ef..a00879d34d54 100644 --- a/arch/arm/mach-kirkwood/sheevaplug-setup.c +++ b/arch/arm/mach-kirkwood/sheevaplug-setup.c @@ -51,6 +51,11 @@ static struct mvsdio_platform_data sheevaplug_mvsdio_data = { /* unfortunately the CD signal has not been connected */ }; +static struct mvsdio_platform_data sheeva_esata_mvsdio_data = { + .gpio_write_protect = 44, /* MPP44 used as SD write protect */ + .gpio_card_detect = 47, /* MPP47 used as SD card detect */ +}; + static struct gpio_led sheevaplug_led_pins[] = { { .name = "plug:green:health", @@ -79,13 +84,26 @@ static unsigned int sheevaplug_mpp_config[] __initdata = { 0 }; +static unsigned int sheeva_esata_mpp_config[] __initdata = { + MPP29_GPIO, /* USB Power Enable */ + MPP44_GPIO, /* SD Write Protect */ + MPP47_GPIO, /* SD Card Detect */ + MPP49_GPIO, /* LED Green */ + 0 +}; + static void __init sheevaplug_init(void) { /* * Basic setup. Needs to be called early. */ kirkwood_init(); - kirkwood_mpp_conf(sheevaplug_mpp_config); + + /* setup gpio pin select */ + if (machine_is_sheeva_esata()) + kirkwood_mpp_conf(sheeva_esata_mpp_config); + else + kirkwood_mpp_conf(sheevaplug_mpp_config); kirkwood_uart0_init(); kirkwood_nand_init(ARRAY_AND_SIZE(sheevaplug_nand_parts), 25); @@ -101,7 +119,11 @@ static void __init sheevaplug_init(void) if (machine_is_sheeva_esata()) kirkwood_sata_init(&sheeva_esata_sata_data); - kirkwood_sdio_init(&sheevaplug_mvsdio_data); + /* enable sd wp and sd cd on plugs with esata */ + if (machine_is_sheeva_esata()) + kirkwood_sdio_init(&sheeva_esata_mvsdio_data); + else + kirkwood_sdio_init(&sheevaplug_mvsdio_data); platform_device_register(&sheevaplug_leds); } -- cgit v1.2.3