linux-arm-kernel.lists.infradead.org archive mirror
 help / color / mirror / Atom feed
* RFC patch set - kirkwood/sheeva - enable eSATA port
@ 2010-02-19 20:55 John Holland
  2010-02-19 21:34 ` Nicolas Pitre
  0 siblings, 1 reply; 5+ messages in thread
From: John Holland @ 2010-02-19 20:55 UTC (permalink / raw)
  To: linux-arm-kernel

Hi there,

included are two patches. The first enables Kconfig and basic board
support for the eSATA version of the SheevaPlug found at
http://www.newit.co.uk/store/index.php?main_page=index&cPath=3. No, I
have no affiliation. The second enables the SATA interfaces on the SoC
to allow eSATA visibility.

I'm opening a discussion to help us decide if the first patch is
necessary. Please keep in mind, I also have a third non-disclosed patch
that enables SD WP/CD on the same hardware: I have seen that the SoC MPP
is also connected to the SD card interface.

http://plugcomputer.org/data/docs/Sheeva-PowerPlug-V1.3-GTI-090906.pdf

Please pardon my git ignorance, but I couldn't find any guidelines
forcing me to use it here.

diff -Naur linux-2.6-2.6.32/arch/arm/mach-kirkwood/Kconfig linux-2.6-2.6.32.new/arch/arm/mach-kirkwood/Kconfig
--- linux-2.6-2.6.32/arch/arm/mach-kirkwood/Kconfig	2009-12-03 04:51:21.000000000 +0100
+++ linux-2.6-2.6.32.new/arch/arm/mach-kirkwood/Kconfig	2010-02-19 18:49:14.099872716 +0100
@@ -32,6 +32,12 @@
 	  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-119 and TS-219 Turbo NAS"
 	help
diff -Naur linux-2.6-2.6.32/arch/arm/mach-kirkwood/Makefile linux-2.6-2.6.32.new/arch/arm/mach-kirkwood/Makefile
--- linux-2.6-2.6.32/arch/arm/mach-kirkwood/Makefile	2009-12-03 04:51:21.000000000 +0100
+++ linux-2.6-2.6.32.new/arch/arm/mach-kirkwood/Makefile	2010-02-19 18:49:14.099872716 +0100
@@ -5,6 +5,7 @@
 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
 obj-$(CONFIG_MACH_OPENRD_BASE)		+= openrd_base-setup.o
 
diff -Naur linux-2.6-2.6.32/arch/arm/mach-kirkwood/sheevaplug-setup.c linux-2.6-2.6.32.new/arch/arm/mach-kirkwood/sheevaplug-setup.c
--- linux-2.6-2.6.32/arch/arm/mach-kirkwood/sheevaplug-setup.c	2009-12-03 04:51:21.000000000 +0100
+++ linux-2.6-2.6.32.new/arch/arm/mach-kirkwood/sheevaplug-setup.c	2010-02-19 18:49:47.403810163 +0100
@@ -96,6 +96,7 @@
 	platform_device_register(&sheevaplug_leds);
 }
 
+#ifdef CONFIG_MACH_SHEEVAPLUG
 MACHINE_START(SHEEVAPLUG, "Marvell SheevaPlug Reference Board")
 	/* Maintainer: shadi Ammouri <shadi@marvell.com> */
 	.phys_io	= KIRKWOOD_REGS_PHYS_BASE,
@@ -106,3 +107,16 @@
 	.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

This to allows people to choose the hardware they want to configure in
u-boot, depending on the application: using the hardware for something
intolerant of "wasted" energy. And leads to the following...

diff -Naur linux-2.6-2.6.32/arch/arm/mach-kirkwood/sheevaplug-setup.c linux-2.6-2.6.32.new/arch/arm/mach-kirkwood/sheevaplug-setup.c
--- linux-2.6-2.6.32/arch/arm/mach-kirkwood/sheevaplug-setup.c	2010-02-19 19:11:30.714071286 +0100
+++ linux-2.6-2.6.32.new/arch/arm/mach-kirkwood/sheevaplug-setup.c	2010-02-19 19:13:51.910761448 +0100
@@ -11,6 +11,7 @@
 #include <linux/kernel.h>
 #include <linux/init.h>
 #include <linux/platform_device.h>
+#include <linux/ata_platform.h>
 #include <linux/mtd/partitions.h>
 #include <linux/mv643xx_eth.h>
 #include <linux/gpio.h>
@@ -42,6 +43,10 @@
 	.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 @@
 	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);


For completeness, these patches do require a current
arm/tools/mach-types.


During my excursions with the new hardware, it was pointed out that the
Sheeva u-boot 3.4.19 does not properly initialize the SoC SATA ports
disallowing further usage; indifferent to the above patches. The "net"
http://plugcomputer.org/plugforum/index.php?topic=927.0 told me to use
u-boot 3.4.19 intended for the openrd hardware, and it worked.



-- 
John Holland

___________________________________________

Cellent Finance Solutions AG

Firmensitz: Calwer Stra?e 33, 70173 Stuttgart
Registergericht: Amtsgericht Stuttgart, HRB 720743
Vorstand: Thomas Wild
Vorsitzender des Aufsichtsrats: Rudolf Zipf

^ permalink raw reply	[flat|nested] 5+ messages in thread

* RFC patch set - kirkwood/sheeva - enable eSATA port
  2010-02-19 20:55 RFC patch set - kirkwood/sheeva - enable eSATA port John Holland
@ 2010-02-19 21:34 ` Nicolas Pitre
  2010-02-19 22:10   ` [PATCH] 1/3 kirkwood/sheeva: basic board support John Holland
                     ` (2 more replies)
  0 siblings, 3 replies; 5+ messages in thread
From: Nicolas Pitre @ 2010-02-19 21:34 UTC (permalink / raw)
  To: linux-arm-kernel

On Fri, 19 Feb 2010, John Holland wrote:

> Hi there,
> 
> included are two patches. The first enables Kconfig and basic board
> support for the eSATA version of the SheevaPlug found at
> http://www.newit.co.uk/store/index.php?main_page=index&cPath=3. No, I
> have no affiliation. The second enables the SATA interfaces on the SoC
> to allow eSATA visibility.
> 
> I'm opening a discussion to help us decide if the first patch is
> necessary. Please keep in mind, I also have a third non-disclosed patch
> that enables SD WP/CD on the same hardware: I have seen that the SoC MPP
> is also connected to the SD card interface.

Please make those 3 separate patches.  And yes I think you need the 
first patch as well.  Some code will be optimized away at compile time 
if one of the configs is not selected.

> Please pardon my git ignorance, but I couldn't find any guidelines
> forcing me to use it here.

You're not forced to use Git.  However I'd prefer if you could post 
those patches separately, one per message, with some explanation blurb 
for each patch and a SOB tag.  See Documentation/SubmittingPatches 
for all the details (apply what makes sense).

> During my excursions with the new hardware, it was pointed out that the
> Sheeva u-boot 3.4.19 does not properly initialize the SoC SATA ports
> disallowing further usage; indifferent to the above patches. The "net"
> http://plugcomputer.org/plugforum/index.php?topic=927.0 told me to use
> u-boot 3.4.19 intended for the openrd hardware, and it worked.

That would be good if someone made the necessary patch to add the proper 
initialization to the kernel eventually.


Nicolas

^ permalink raw reply	[flat|nested] 5+ messages in thread

* [PATCH] 1/3 kirkwood/sheeva: basic board support
  2010-02-19 21:34 ` Nicolas Pitre
@ 2010-02-19 22:10   ` John Holland
  2010-02-19 22:11   ` [PATCH] 2/3 kirkwood/sheeva: configure SoC SATA interface John Holland
  2010-02-19 22:11   ` [PATCH] 3/3 kirkwood/sheeva: correlate MPP to SD CD and SD WP John Holland
  2 siblings, 0 replies; 5+ messages in thread
From: John Holland @ 2010-02-19 22:10 UTC (permalink / raw)
  To: linux-arm-kernel

Allow basic eSATA SheevaPlug board configuration and build.

Signed-off-by: John Holland <john.holland@cellent-fs.de>
--
diff -Naur linux-2.6-2.6.32/arch/arm/mach-kirkwood/Kconfig linux-2.6-2.6.32.new/arch/arm/mach-kirkwood/Kconfig
--- linux-2.6-2.6.32/arch/arm/mach-kirkwood/Kconfig	2009-12-03 04:51:21.000000000 +0100
+++ linux-2.6-2.6.32.new/arch/arm/mach-kirkwood/Kconfig	2010-02-19 18:49:14.099872716 +0100
@@ -32,6 +32,12 @@
 	  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-119 and TS-219 Turbo NAS"
 	help
diff -Naur linux-2.6-2.6.32/arch/arm/mach-kirkwood/Makefile linux-2.6-2.6.32.new/arch/arm/mach-kirkwood/Makefile
--- linux-2.6-2.6.32/arch/arm/mach-kirkwood/Makefile	2009-12-03 04:51:21.000000000 +0100
+++ linux-2.6-2.6.32.new/arch/arm/mach-kirkwood/Makefile	2010-02-19 18:49:14.099872716 +0100
@@ -5,6 +5,7 @@
 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
 obj-$(CONFIG_MACH_OPENRD_BASE)		+= openrd_base-setup.o
 
diff -Naur linux-2.6-2.6.32/arch/arm/mach-kirkwood/sheevaplug-setup.c linux-2.6-2.6.32.new/arch/arm/mach-kirkwood/sheevaplug-setup.c
--- linux-2.6-2.6.32/arch/arm/mach-kirkwood/sheevaplug-setup.c	2009-12-03 04:51:21.000000000 +0100
+++ linux-2.6-2.6.32.new/arch/arm/mach-kirkwood/sheevaplug-setup.c	2010-02-19 18:49:47.403810163 +0100
@@ -96,6 +96,7 @@
 	platform_device_register(&sheevaplug_leds);
 }
 
+#ifdef CONFIG_MACH_SHEEVAPLUG
 MACHINE_START(SHEEVAPLUG, "Marvell SheevaPlug Reference Board")
 	/* Maintainer: shadi Ammouri <shadi@marvell.com> */
 	.phys_io	= KIRKWOOD_REGS_PHYS_BASE,
@@ -106,3 +107,16 @@
 	.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


-- 
John Holland

___________________________________________

Cellent Finance Solutions AG

Firmensitz: Calwer Stra?e 33, 70173 Stuttgart
Registergericht: Amtsgericht Stuttgart, HRB 720743
Vorstand: Thomas Wild
Vorsitzender des Aufsichtsrats: Rudolf Zipf

^ permalink raw reply	[flat|nested] 5+ messages in thread

* [PATCH] 2/3 kirkwood/sheeva: configure SoC SATA interface
  2010-02-19 21:34 ` Nicolas Pitre
  2010-02-19 22:10   ` [PATCH] 1/3 kirkwood/sheeva: basic board support John Holland
@ 2010-02-19 22:11   ` John Holland
  2010-02-19 22:11   ` [PATCH] 3/3 kirkwood/sheeva: correlate MPP to SD CD and SD WP John Holland
  2 siblings, 0 replies; 5+ messages in thread
From: John Holland @ 2010-02-19 22:11 UTC (permalink / raw)
  To: linux-arm-kernel

Enable the kirkwood SATA SoC interface on the eSATA SheevaPlug.

Signed-off-by: John Holland <john.holland@cellent-fs.de>
--
diff -Naur linux-2.6-2.6.32/arch/arm/mach-kirkwood/sheevaplug-setup.c linux-2.6-2.6.32.new/arch/arm/mach-kirkwood/sheevaplug-setup.c
--- linux-2.6-2.6.32/arch/arm/mach-kirkwood/sheevaplug-setup.c	2010-02-19 19:11:30.714071286 +0100
+++ linux-2.6-2.6.32.new/arch/arm/mach-kirkwood/sheevaplug-setup.c	2010-02-19 19:13:51.910761448 +0100
@@ -11,6 +11,7 @@
 #include <linux/kernel.h>
 #include <linux/init.h>
 #include <linux/platform_device.h>
+#include <linux/ata_platform.h>
 #include <linux/mtd/partitions.h>
 #include <linux/mv643xx_eth.h>
 #include <linux/gpio.h>
@@ -42,6 +43,10 @@
 	.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 @@
 	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);


-- 
John Holland

___________________________________________

Cellent Finance Solutions AG

Firmensitz: Calwer Stra?e 33, 70173 Stuttgart
Registergericht: Amtsgericht Stuttgart, HRB 720743
Vorstand: Thomas Wild
Vorsitzender des Aufsichtsrats: Rudolf Zipf

^ permalink raw reply	[flat|nested] 5+ messages in thread

* [PATCH] 3/3 kirkwood/sheeva: correlate MPP to SD CD and SD WP
  2010-02-19 21:34 ` Nicolas Pitre
  2010-02-19 22:10   ` [PATCH] 1/3 kirkwood/sheeva: basic board support John Holland
  2010-02-19 22:11   ` [PATCH] 2/3 kirkwood/sheeva: configure SoC SATA interface John Holland
@ 2010-02-19 22:11   ` John Holland
  2 siblings, 0 replies; 5+ messages in thread
From: John Holland @ 2010-02-19 22:11 UTC (permalink / raw)
  To: linux-arm-kernel

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 <john.holland@cellent-fs.de>
--
diff -Naur linux-2.6-2.6.32/arch/arm/mach-kirkwood/sheevaplug-setup.c linux-2.6-2.6.32.new/arch/arm/mach-kirkwood/sheevaplug-setup.c
--- linux-2.6-2.6.32/arch/arm/mach-kirkwood/sheevaplug-setup.c	2010-02-19 19:15:49.643951762 +0100
+++ linux-2.6-2.6.32.new/arch/arm/mach-kirkwood/sheevaplug-setup.c	2010-02-19 19:18:13.249598152 +0100
@@ -51,6 +51,11 @@
 	/* 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 @@
 	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 @@
 	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);
 }

Although this has not yet been thoroughly tested, it has no noticeable
adverse effects.

-- 
John Holland

___________________________________________

Cellent Finance Solutions AG

Firmensitz: Calwer Stra?e 33, 70173 Stuttgart
Registergericht: Amtsgericht Stuttgart, HRB 720743
Vorstand: Thomas Wild
Vorsitzender des Aufsichtsrats: Rudolf Zipf

^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2010-02-19 22:11 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2010-02-19 20:55 RFC patch set - kirkwood/sheeva - enable eSATA port John Holland
2010-02-19 21:34 ` Nicolas Pitre
2010-02-19 22:10   ` [PATCH] 1/3 kirkwood/sheeva: basic board support John Holland
2010-02-19 22:11   ` [PATCH] 2/3 kirkwood/sheeva: configure SoC SATA interface John Holland
2010-02-19 22:11   ` [PATCH] 3/3 kirkwood/sheeva: correlate MPP to SD CD and SD WP John Holland

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).