linux-arm-kernel.lists.infradead.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] Marvell OpenRD-Ultimate machine support
@ 2010-06-08 17:24 Dmytro Milinevskyy
  2010-06-08 17:38 ` Joe Perches
  2010-06-08 17:45 ` Lennert Buytenhek
  0 siblings, 2 replies; 16+ messages in thread
From: Dmytro Milinevskyy @ 2010-06-08 17:24 UTC (permalink / raw)
  To: linux-arm-kernel

Hello!
This patch adds support for the OpenRD Ultimate machine(could be found at http://www.arm.linux.org.uk/developer/machines/list.php?id=2884)

It slightly differs from Client version.

Also this patch adds correction for PHY address for Ultimate version.

Regards,

-- Dmytro Milinevskyy

Signed-off-by: Dmytro Milinevskyy <milinevskyy@gmail.com>
---
 arch/arm/mach-kirkwood/Kconfig        |    7 ++++++
 arch/arm/mach-kirkwood/openrd-setup.c |   34 +++++++++++++++++++++++++++++---
 2 files changed, 37 insertions(+), 4 deletions(-)

diff --git a/arch/arm/mach-kirkwood/Kconfig b/arch/arm/mach-kirkwood/Kconfig
index 29b2163..110a3b8 100644
--- a/arch/arm/mach-kirkwood/Kconfig
+++ b/arch/arm/mach-kirkwood/Kconfig
@@ -75,6 +75,13 @@ config MACH_OPENRD_CLIENT
 	  Say 'Y' here if you want your kernel to support the
 	  Marvell OpenRD Client Board.
 
+config MACH_OPENRD_ULTIMATE
+	bool "Marvell OpenRD Ultimate Board"
+	select MACH_OPENRD
+	help
+	  Say 'Y' here if you want your kernel to support the
+	  Marvell OpenRD Ultimate Board.
+
 config MACH_NETSPACE_V2
 	bool "LaCie Network Space v2 NAS Board"
 	help
diff --git a/arch/arm/mach-kirkwood/openrd-setup.c b/arch/arm/mach-kirkwood/openrd-setup.c
index ad3f1ec..5d6797a 100644
--- a/arch/arm/mach-kirkwood/openrd-setup.c
+++ b/arch/arm/mach-kirkwood/openrd-setup.c
@@ -47,6 +47,14 @@ static struct mv643xx_eth_platform_data openrd_ge01_data = {
 	.phy_addr	= MV643XX_ETH_PHY_ADDR(24),
 };
 
+static struct mv643xx_eth_platform_data openrd_ultimate_ge00_data = {
+	.phy_addr	= MV643XX_ETH_PHY_ADDR(0),
+};
+
+static struct mv643xx_eth_platform_data openrd_ultimate_ge01_data = {
+	.phy_addr	= MV643XX_ETH_PHY_ADDR(1),
+};
+
 static struct mv_sata_platform_data openrd_sata_data = {
 	.n_ports	= 2,
 };
@@ -73,9 +81,14 @@ static void __init openrd_init(void)
 
 	kirkwood_ehci_init();
 
-	kirkwood_ge00_init(&openrd_ge00_data);
-	if (machine_is_openrd_client())
-		kirkwood_ge01_init(&openrd_ge01_data);
+	if (machine_is_openrd_ultimate()) {
+		kirkwood_ge00_init(&openrd_ultimate_ge00_data);
+		kirkwood_ge01_init(&openrd_ultimate_ge01_data);
+	} else {
+		kirkwood_ge00_init(&openrd_ge00_data);
+		if (machine_is_openrd_client())
+			kirkwood_ge01_init(&openrd_ge01_data);
+	}
 	kirkwood_sata_init(&openrd_sata_data);
 	kirkwood_sdio_init(&openrd_mvsdio_data);
 
@@ -84,7 +97,7 @@ static void __init openrd_init(void)
 
 static int __init openrd_pci_init(void)
 {
-	if (machine_is_openrd_base() || machine_is_openrd_client())
+	if (machine_is_openrd_base() || machine_is_openrd_client() || machine_is_openrd_ultimate())
 		kirkwood_pcie_init();
 
 	return 0;
@@ -116,3 +129,16 @@ MACHINE_START(OPENRD_CLIENT, "Marvell OpenRD Client Board")
 	.timer		= &kirkwood_timer,
 MACHINE_END
 #endif
+
+#ifdef CONFIG_MACH_OPENRD_ULTIMATE
+MACHINE_START(OPENRD_ULTIMATE, "Marvell OpenRD Ultimate Board")
+	/* Maintainer: Dhaval Vasa <dhaval.vasa@einfochips.com> */
+	.phys_io	= KIRKWOOD_REGS_PHYS_BASE,
+	.io_pg_offst	= ((KIRKWOOD_REGS_VIRT_BASE) >> 18) & 0xfffc,
+	.boot_params	= 0x00000100,
+	.init_machine	= openrd_init,
+	.map_io		= kirkwood_map_io,
+	.init_irq	= kirkwood_init_irq,
+	.timer		= &kirkwood_timer,
+MACHINE_END
+#endif
-- 
1.7.1

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

* [PATCH] Marvell OpenRD-Ultimate machine support
  2010-06-08 17:24 [PATCH] Marvell OpenRD-Ultimate machine support Dmytro Milinevskyy
@ 2010-06-08 17:38 ` Joe Perches
  2010-06-08 17:45 ` Lennert Buytenhek
  1 sibling, 0 replies; 16+ messages in thread
From: Joe Perches @ 2010-06-08 17:38 UTC (permalink / raw)
  To: linux-arm-kernel

On Tue, 2010-06-08 at 20:24 +0300, Dmytro Milinevskyy wrote:
> @@ -73,9 +81,14 @@ static void __init openrd_init(void)
>  
>  	kirkwood_ehci_init();
>  
> -	kirkwood_ge00_init(&openrd_ge00_data);
> -	if (machine_is_openrd_client())
> -		kirkwood_ge01_init(&openrd_ge01_data);
> +	if (machine_is_openrd_ultimate()) {
> +		kirkwood_ge00_init(&openrd_ultimate_ge00_data);
> +		kirkwood_ge01_init(&openrd_ultimate_ge01_data);
> +	} else {
> +		kirkwood_ge00_init(&openrd_ge00_data);
> +		if (machine_is_openrd_client())
> +			kirkwood_ge01_init(&openrd_ge01_data);
> +	}

Perhaps some utility functions like:

	if (kirkwood_has_multiple_ethernets())?

> @@ -84,7 +97,7 @@ static void __init openrd_init(void)
>  
>  static int __init openrd_pci_init(void)
>  {
> -	if (machine_is_openrd_base() || machine_is_openrd_client())
> +	if (machine_is_openrd_base() || machine_is_openrd_client() || machine_is_openrd_ultimate())

	if (kirkwood_has_pcie()?

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

* [PATCH] Marvell OpenRD-Ultimate machine support
  2010-06-08 17:24 [PATCH] Marvell OpenRD-Ultimate machine support Dmytro Milinevskyy
  2010-06-08 17:38 ` Joe Perches
@ 2010-06-08 17:45 ` Lennert Buytenhek
  1 sibling, 0 replies; 16+ messages in thread
From: Lennert Buytenhek @ 2010-06-08 17:45 UTC (permalink / raw)
  To: linux-arm-kernel

On Tue, Jun 08, 2010 at 08:24:40PM +0300, Dmytro Milinevskyy wrote:

> diff --git a/arch/arm/mach-kirkwood/openrd-setup.c b/arch/arm/mach-kirkwood/openrd-setup.c
> index ad3f1ec..5d6797a 100644
> --- a/arch/arm/mach-kirkwood/openrd-setup.c
> +++ b/arch/arm/mach-kirkwood/openrd-setup.c
> @@ -47,6 +47,14 @@ static struct mv643xx_eth_platform_data openrd_ge01_data = {
>  	.phy_addr	= MV643XX_ETH_PHY_ADDR(24),
>  };
>  
> +static struct mv643xx_eth_platform_data openrd_ultimate_ge00_data = {
> +	.phy_addr	= MV643XX_ETH_PHY_ADDR(0),
> +};
> +
> +static struct mv643xx_eth_platform_data openrd_ultimate_ge01_data = {
> +	.phy_addr	= MV643XX_ETH_PHY_ADDR(1),
> +};
> +
>  static struct mv_sata_platform_data openrd_sata_data = {
>  	.n_ports	= 2,
>  };
> @@ -73,9 +81,14 @@ static void __init openrd_init(void)
>  
>  	kirkwood_ehci_init();
>  
> -	kirkwood_ge00_init(&openrd_ge00_data);
> -	if (machine_is_openrd_client())
> -		kirkwood_ge01_init(&openrd_ge01_data);
> +	if (machine_is_openrd_ultimate()) {
> +		kirkwood_ge00_init(&openrd_ultimate_ge00_data);
> +		kirkwood_ge01_init(&openrd_ultimate_ge01_data);
> +	} else {
> +		kirkwood_ge00_init(&openrd_ge00_data);
> +		if (machine_is_openrd_client())
> +			kirkwood_ge01_init(&openrd_ge01_data);
> +	}

Just write the PHY addresses into openrd_ge0[01]_data here iff
machine_is_openrd_ultimate()?

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

* [PATCH] Marvell OpenRD-Ultimate machine support
@ 2010-06-08 19:47 Dmytro Milinevskyy
  2010-06-09  7:25 ` Lennert Buytenhek
  0 siblings, 1 reply; 16+ messages in thread
From: Dmytro Milinevskyy @ 2010-06-08 19:47 UTC (permalink / raw)
  To: linux-arm-kernel

Hi!
This patch adds support for the OpenRD Ultimate machine(could be found at http://www.arm.linux.org.uk/developer/machines/list.php?id=2884)

Besides adding machine description this patch adds correction for PHY address for Ultimate version.

Differences from the previous attempt:
 - Applied suggestion from Lennert Buytenhek to change PHY addresses in instances of mv643xx_eth_platform_data in case of ultimate version.

Regards,

-- Dmytro Milinevskyy

Signed-off-by: Dmytro Milinevskyy <milinevskyy@gmail.com>
---
 arch/arm/mach-kirkwood/Kconfig        |    7 ++++++
 arch/arm/mach-kirkwood/openrd-setup.c |   34 +++++++++++++++++++++++++++++---
 2 files changed, 37 insertions(+), 4 deletions(-)

diff --git a/arch/arm/mach-kirkwood/Kconfig b/arch/arm/mach-kirkwood/Kconfig
index 29b2163..110a3b8 100644
--- a/arch/arm/mach-kirkwood/Kconfig
+++ b/arch/arm/mach-kirkwood/Kconfig
@@ -75,6 +75,13 @@ config MACH_OPENRD_CLIENT
 	  Say 'Y' here if you want your kernel to support the
 	  Marvell OpenRD Client Board.
 
+config MACH_OPENRD_ULTIMATE
+	bool "Marvell OpenRD Ultimate Board"
+	select MACH_OPENRD
+	help
+	  Say 'Y' here if you want your kernel to support the
+	  Marvell OpenRD Ultimate Board.
+
 config MACH_NETSPACE_V2
 	bool "LaCie Network Space v2 NAS Board"
 	help
diff --git a/arch/arm/mach-kirkwood/openrd-setup.c b/arch/arm/mach-kirkwood/openrd-setup.c
index ad3f1ec..5d6797a 100644
--- a/arch/arm/mach-kirkwood/openrd-setup.c
+++ b/arch/arm/mach-kirkwood/openrd-setup.c
@@ -47,6 +47,14 @@ static struct mv643xx_eth_platform_data openrd_ge01_data = {
 	.phy_addr	= MV643XX_ETH_PHY_ADDR(24),
 };
 
+static struct mv643xx_eth_platform_data openrd_ultimate_ge00_data = {
+	.phy_addr	= MV643XX_ETH_PHY_ADDR(0),
+};
+
+static struct mv643xx_eth_platform_data openrd_ultimate_ge01_data = {
+	.phy_addr	= MV643XX_ETH_PHY_ADDR(1),
+};
+
 static struct mv_sata_platform_data openrd_sata_data = {
 	.n_ports	= 2,
 };
@@ -73,9 +81,14 @@ static void __init openrd_init(void)
 
 	kirkwood_ehci_init();
 
-	kirkwood_ge00_init(&openrd_ge00_data);
-	if (machine_is_openrd_client())
-		kirkwood_ge01_init(&openrd_ge01_data);
+	if (machine_is_openrd_ultimate()) {
+		kirkwood_ge00_init(&openrd_ultimate_ge00_data);
+		kirkwood_ge01_init(&openrd_ultimate_ge01_data);
+	} else {
+		kirkwood_ge00_init(&openrd_ge00_data);
+		if (machine_is_openrd_client())
+			kirkwood_ge01_init(&openrd_ge01_data);
+	}
 	kirkwood_sata_init(&openrd_sata_data);
 	kirkwood_sdio_init(&openrd_mvsdio_data);
 
@@ -84,7 +97,7 @@ static void __init openrd_init(void)
 
 static int __init openrd_pci_init(void)
 {
-	if (machine_is_openrd_base() || machine_is_openrd_client())
+	if (machine_is_openrd_base() || machine_is_openrd_client() || machine_is_openrd_ultimate())
 		kirkwood_pcie_init();
 
 	return 0;
@@ -116,3 +129,16 @@ MACHINE_START(OPENRD_CLIENT, "Marvell OpenRD Client Board")
 	.timer		= &kirkwood_timer,
 MACHINE_END
 #endif
+
+#ifdef CONFIG_MACH_OPENRD_ULTIMATE
+MACHINE_START(OPENRD_ULTIMATE, "Marvell OpenRD Ultimate Board")
+	/* Maintainer: Dhaval Vasa <dhaval.vasa@einfochips.com> */
+	.phys_io	= KIRKWOOD_REGS_PHYS_BASE,
+	.io_pg_offst	= ((KIRKWOOD_REGS_VIRT_BASE) >> 18) & 0xfffc,
+	.boot_params	= 0x00000100,
+	.init_machine	= openrd_init,
+	.map_io		= kirkwood_map_io,
+	.init_irq	= kirkwood_init_irq,
+	.timer		= &kirkwood_timer,
+MACHINE_END
+#endif
-- 
1.7.1

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

* [PATCH] Marvell OpenRD-Ultimate machine support
  2010-06-08 19:47 Dmytro Milinevskyy
@ 2010-06-09  7:25 ` Lennert Buytenhek
  2010-06-09  7:37   ` Dmytro Milinevskyy
  0 siblings, 1 reply; 16+ messages in thread
From: Lennert Buytenhek @ 2010-06-09  7:25 UTC (permalink / raw)
  To: linux-arm-kernel

On Tue, Jun 08, 2010 at 10:47:47PM +0300, Dmytro Milinevskyy wrote:

> Differences from the previous attempt:
>  - Applied suggestion from Lennert Buytenhek to change PHY addresses in instances of mv643xx_eth_platform_data in case of ultimate version.

The patch looks exactly like the old patch, though?

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

* [PATCH] Marvell OpenRD-Ultimate machine support
  2010-06-09  7:25 ` Lennert Buytenhek
@ 2010-06-09  7:37   ` Dmytro Milinevskyy
  0 siblings, 0 replies; 16+ messages in thread
From: Dmytro Milinevskyy @ 2010-06-09  7:37 UTC (permalink / raw)
  To: linux-arm-kernel

Oh, I've sent the old version.

My apologies. Will resend the updates version as soon as I get access
to the box.

-- Dima

On Wed, Jun 9, 2010 at 10:25 AM, Lennert Buytenhek
<buytenh@wantstofly.org> wrote:
> On Tue, Jun 08, 2010 at 10:47:47PM +0300, Dmytro Milinevskyy wrote:
>
>> Differences from the previous attempt:
>> ?- Applied suggestion from Lennert Buytenhek to change PHY addresses in instances of mv643xx_eth_platform_data in case of ultimate version.
>
> The patch looks exactly like the old patch, though?
>

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

* [PATCH] Marvell OpenRD-Ultimate machine support
@ 2010-06-09 20:14 Dmytro Milinevskyy
  2010-06-09 20:37 ` Alexander Clouter
  0 siblings, 1 reply; 16+ messages in thread
From: Dmytro Milinevskyy @ 2010-06-09 20:14 UTC (permalink / raw)
  To: linux-arm-kernel

Hi!
This patch adds support for the OpenRD Ultimate machine(could be found at http://www.arm.linux.org.uk/developer/machines/list.php?id=2884)

Besides adding machine description this patch adds correction for PHY address for Ultimate version.

Differences from the previous attempt:
 - Applied suggestion from Lennert Buytenhek to change PHY addresses in instances of mv643xx_eth_platform_data in case of ultimate version.

Regards,

-- Dmytro Milinevskyy


Signed-off-by: Dmytro Milinevskyy <milinevskyy@gmail.com>
---
 arch/arm/mach-kirkwood/Kconfig        |    7 +++++++
 arch/arm/mach-kirkwood/openrd-setup.c |   28 +++++++++++++++++++++++++---
 2 files changed, 32 insertions(+), 3 deletions(-)

diff --git a/arch/arm/mach-kirkwood/Kconfig b/arch/arm/mach-kirkwood/Kconfig
index 29b2163..110a3b8 100644
--- a/arch/arm/mach-kirkwood/Kconfig
+++ b/arch/arm/mach-kirkwood/Kconfig
@@ -75,6 +75,13 @@ config MACH_OPENRD_CLIENT
 	  Say 'Y' here if you want your kernel to support the
 	  Marvell OpenRD Client Board.
 
+config MACH_OPENRD_ULTIMATE
+	bool "Marvell OpenRD Ultimate Board"
+	select MACH_OPENRD
+	help
+	  Say 'Y' here if you want your kernel to support the
+	  Marvell OpenRD Ultimate Board.
+
 config MACH_NETSPACE_V2
 	bool "LaCie Network Space v2 NAS Board"
 	help
diff --git a/arch/arm/mach-kirkwood/openrd-setup.c b/arch/arm/mach-kirkwood/openrd-setup.c
index ad3f1ec..81b330d 100644
--- a/arch/arm/mach-kirkwood/openrd-setup.c
+++ b/arch/arm/mach-kirkwood/openrd-setup.c
@@ -1,7 +1,7 @@
 /*
  * arch/arm/mach-kirkwood/openrd-setup.c
  *
- * Marvell OpenRD (Base|Client) Board Setup
+ * Marvell OpenRD (Base|Client|Ultimate) Board Setup
  *
  * This file is licensed under the terms of the GNU General Public
  * License version 2.  This program is licensed "as is" without any
@@ -73,9 +73,16 @@ static void __init openrd_init(void)
 
 	kirkwood_ehci_init();
 
+	if (machine_is_openrd_ultimate()) {
+		openrd_ge00_data.phy = 0;
+		openrd_ge01_data.phy = 1;
+	}
+
 	kirkwood_ge00_init(&openrd_ge00_data);
-	if (machine_is_openrd_client())
+	if (machine_is_openrd_client() ||
+		machine_is_openrd_ultimate())
 		kirkwood_ge01_init(&openrd_ge01_data);
+
 	kirkwood_sata_init(&openrd_sata_data);
 	kirkwood_sdio_init(&openrd_mvsdio_data);
 
@@ -84,7 +91,9 @@ static void __init openrd_init(void)
 
 static int __init openrd_pci_init(void)
 {
-	if (machine_is_openrd_base() || machine_is_openrd_client())
+	if (machine_is_openrd_base() ||
+		machine_is_openrd_client() ||
+		machine_is_openrd_ultimate())
 		kirkwood_pcie_init();
 
 	return 0;
@@ -116,3 +125,16 @@ MACHINE_START(OPENRD_CLIENT, "Marvell OpenRD Client Board")
 	.timer		= &kirkwood_timer,
 MACHINE_END
 #endif
+
+#ifdef CONFIG_MACH_OPENRD_ULTIMATE
+MACHINE_START(OPENRD_ULTIMATE, "Marvell OpenRD Ultimate Board")
+	/* Maintainer: Dhaval Vasa <dhaval.vasa@einfochips.com> */
+	.phys_io	= KIRKWOOD_REGS_PHYS_BASE,
+	.io_pg_offst	= ((KIRKWOOD_REGS_VIRT_BASE) >> 18) & 0xfffc,
+	.boot_params	= 0x00000100,
+	.init_machine	= openrd_init,
+	.map_io		= kirkwood_map_io,
+	.init_irq	= kirkwood_init_irq,
+	.timer		= &kirkwood_timer,
+MACHINE_END
+#endif
-- 
1.7.1

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

* [PATCH] Marvell OpenRD-Ultimate machine support
  2010-06-09 20:14 Dmytro Milinevskyy
@ 2010-06-09 20:37 ` Alexander Clouter
  2010-06-09 20:39   ` Alexander Clouter
  0 siblings, 1 reply; 16+ messages in thread
From: Alexander Clouter @ 2010-06-09 20:37 UTC (permalink / raw)
  To: linux-arm-kernel

Hi,

* Dmytro Milinevskyy <milinevskyy@gmail.com> [2010-06-09 23:14:39+0300]:
>
> This patch adds support for the OpenRD Ultimate machine(could be found 
> at http://www.arm.linux.org.uk/developer/machines/list.php?id=2884)
> 
> Besides adding machine description this patch adds correction for PHY 
> address for Ultimate version.
> 
> Differences from the previous attempt:
>  - Applied suggestion from Lennert Buytenhek to change PHY addresses 
>  in instances of mv643xx_eth_platform_data in case of ultimate 
>  version.
> 
> Signed-off-by: Dmytro Milinevskyy <milinevskyy@gmail.com>
> ---
>  
> +	if (machine_is_openrd_ultimate()) {
> +		openrd_ge00_data.phy = 0;
> +		openrd_ge01_data.phy = 1;
> +	}
> +
>
Does this even work?  Surely you mean the following instead:
----
if (machine_is_openrd_ultimate()) {
	openrd_ge00_data.phy_addr = MV643XX_ETH_PHY_ADDR(0);
	openrd_ge00_data.phy_addr = MV643XX_ETH_PHY_ADDR(1);
}
----

>  	kirkwood_ge00_init(&openrd_ge00_data);
> -	if (machine_is_openrd_client())
> +	if (machine_is_openrd_client() ||      \__same line
> +		machine_is_openrd_ultimate())  /
>  		kirkwood_ge01_init(&openrd_ge01_data);
> +  <------- REMOVE
>  	kirkwood_sata_init(&openrd_sata_data);
>  	kirkwood_sdio_init(&openrd_mvsdio_data);
>  
As that 'if()' clause is still less than 77 chars wide:
----
kirkwood_ge00_init(&openrd_ge00_data);
if (machine_is_openrd_client() || machine_is_openrd_ultimate())
	kirkwood_ge01_init(&openrd_ge01_data);
kirkwood_sata_init(&openrd_sata_data);
kirkwood_sdio_init(&openrd_mvsdio_data);
----

Cheers

-- 
Alexander Clouter
.sigmonster says: People respond to people who respond.

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

* [PATCH] Marvell OpenRD-Ultimate machine support
  2010-06-09 20:37 ` Alexander Clouter
@ 2010-06-09 20:39   ` Alexander Clouter
  2010-06-09 20:42     ` Lennert Buytenhek
  0 siblings, 1 reply; 16+ messages in thread
From: Alexander Clouter @ 2010-06-09 20:39 UTC (permalink / raw)
  To: linux-arm-kernel

Hi,

* Alexander Clouter <alex@digriz.org.uk> [2010-06-09 21:37:20+0100]:
>
> >  	kirkwood_ge00_init(&openrd_ge00_data);
> > -	if (machine_is_openrd_client())
> > +	if (machine_is_openrd_client() ||      \__same line
> > +		machine_is_openrd_ultimate())  /
> >  		kirkwood_ge01_init(&openrd_ge01_data);
> > +  <------- REMOVE
> >  	kirkwood_sata_init(&openrd_sata_data);
> >  	kirkwood_sdio_init(&openrd_mvsdio_data);
> >  
> As that 'if()' clause is still less than 77 chars wide:
> ----
> kirkwood_ge00_init(&openrd_ge00_data);
> if (machine_is_openrd_client() || machine_is_openrd_ultimate())
> 	kirkwood_ge01_init(&openrd_ge01_data);
> kirkwood_sata_init(&openrd_sata_data);
> kirkwood_sdio_init(&openrd_mvsdio_data);
> ----
> 
Better still, just make this 'if(!machine_is_openrd_base())'.

Cheers

-- 
Alexander Clouter
.sigmonster says: What this country needs is a good five cent microcomputer.

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

* [PATCH] Marvell OpenRD-Ultimate machine support
  2010-06-09 20:39   ` Alexander Clouter
@ 2010-06-09 20:42     ` Lennert Buytenhek
  2010-06-10  1:56       ` Dmytro Milinevskyy
  0 siblings, 1 reply; 16+ messages in thread
From: Lennert Buytenhek @ 2010-06-09 20:42 UTC (permalink / raw)
  To: linux-arm-kernel

On Wed, Jun 09, 2010 at 09:39:29PM +0100, Alexander Clouter wrote:

> > >  	kirkwood_ge00_init(&openrd_ge00_data);
> > > -	if (machine_is_openrd_client())
> > > +	if (machine_is_openrd_client() ||      \__same line
> > > +		machine_is_openrd_ultimate())  /
> > >  		kirkwood_ge01_init(&openrd_ge01_data);
> > > +  <------- REMOVE
> > >  	kirkwood_sata_init(&openrd_sata_data);
> > >  	kirkwood_sdio_init(&openrd_mvsdio_data);
> > >  
> > As that 'if()' clause is still less than 77 chars wide:
> > ----
> > kirkwood_ge00_init(&openrd_ge00_data);
> > if (machine_is_openrd_client() || machine_is_openrd_ultimate())
> > 	kirkwood_ge01_init(&openrd_ge01_data);
> > kirkwood_sata_init(&openrd_sata_data);
> > kirkwood_sdio_init(&openrd_mvsdio_data);
> > ----
> 
> Better still, just make this 'if(!machine_is_openrd_base())'.

That form is more error prone when someone adds the OpenRD-SuperDuper,
though.

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

* [PATCH] Marvell OpenRD-Ultimate machine support
  2010-06-09 20:42     ` Lennert Buytenhek
@ 2010-06-10  1:56       ` Dmytro Milinevskyy
  0 siblings, 0 replies; 16+ messages in thread
From: Dmytro Milinevskyy @ 2010-06-10  1:56 UTC (permalink / raw)
  To: linux-arm-kernel

Hi!

>>
>> Better still, just make this 'if(!machine_is_openrd_base())'.
>
> That form is more error prone when someone adds the OpenRD-SuperDuper,
> though.
>

I agree, and the similar could be done in pcie initialization.

-- Dima

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

* [PATCH] Marvell OpenRD-Ultimate machine support
@ 2010-06-10  2:24 Dmytro Milinevskyy
  2010-06-10  5:50 ` Alexander Clouter
  0 siblings, 1 reply; 16+ messages in thread
From: Dmytro Milinevskyy @ 2010-06-10  2:24 UTC (permalink / raw)
  To: linux-arm-kernel

Hi!
This patch adds support for the OpenRD Ultimate machine(could be found at http://www.arm.linux.org.uk/developer/machines/list.php?id=2884)

Besides adding machine description this patch adds correction for PHY address for Ultimate version.

Differences from the previous attempt:
 - Correctly filled instances of mv643xx_eth_platform_data in case of ultimate version.
 - Do PCIE initialization w/o additional checks since all openrd types have it
 - Init ge01 if (!openrd-base) to make the code cleaner

Regards,

-- Dmytro Milinevskyy

Signed-off-by: Dmytro Milinevskyy <milinevskyy@gmail.com>
---
 arch/arm/mach-kirkwood/Kconfig        |    7 +++++++
 arch/arm/mach-kirkwood/openrd-setup.c |   26 ++++++++++++++++++++++----
 2 files changed, 29 insertions(+), 4 deletions(-)

diff --git a/arch/arm/mach-kirkwood/Kconfig b/arch/arm/mach-kirkwood/Kconfig
index 29b2163..110a3b8 100644
--- a/arch/arm/mach-kirkwood/Kconfig
+++ b/arch/arm/mach-kirkwood/Kconfig
@@ -75,6 +75,13 @@ config MACH_OPENRD_CLIENT
 	  Say 'Y' here if you want your kernel to support the
 	  Marvell OpenRD Client Board.
 
+config MACH_OPENRD_ULTIMATE
+	bool "Marvell OpenRD Ultimate Board"
+	select MACH_OPENRD
+	help
+	  Say 'Y' here if you want your kernel to support the
+	  Marvell OpenRD Ultimate Board.
+
 config MACH_NETSPACE_V2
 	bool "LaCie Network Space v2 NAS Board"
 	help
diff --git a/arch/arm/mach-kirkwood/openrd-setup.c b/arch/arm/mach-kirkwood/openrd-setup.c
index ad3f1ec..c3d8c60 100644
--- a/arch/arm/mach-kirkwood/openrd-setup.c
+++ b/arch/arm/mach-kirkwood/openrd-setup.c
@@ -1,7 +1,7 @@
 /*
  * arch/arm/mach-kirkwood/openrd-setup.c
  *
- * Marvell OpenRD (Base|Client) Board Setup
+ * Marvell OpenRD (Base|Client|Ultimate) Board Setup
  *
  * This file is licensed under the terms of the GNU General Public
  * License version 2.  This program is licensed "as is" without any
@@ -73,9 +73,15 @@ static void __init openrd_init(void)
 
 	kirkwood_ehci_init();
 
+	if (machine_is_openrd_ultimate()) {
+		openrd_ge00_data.phy_addr = MV643XX_ETH_PHY_ADDR(0);
+		openrd_ge01_data.phy_addr = MV643XX_ETH_PHY_ADDR(1);
+	}
+
 	kirkwood_ge00_init(&openrd_ge00_data);
-	if (machine_is_openrd_client())
+	if (!machine_is_openrd_base())
 		kirkwood_ge01_init(&openrd_ge01_data);
+
 	kirkwood_sata_init(&openrd_sata_data);
 	kirkwood_sdio_init(&openrd_mvsdio_data);
 
@@ -84,8 +90,7 @@ static void __init openrd_init(void)
 
 static int __init openrd_pci_init(void)
 {
-	if (machine_is_openrd_base() || machine_is_openrd_client())
-		kirkwood_pcie_init();
+	kirkwood_pcie_init();
 
 	return 0;
 }
@@ -116,3 +121,16 @@ MACHINE_START(OPENRD_CLIENT, "Marvell OpenRD Client Board")
 	.timer		= &kirkwood_timer,
 MACHINE_END
 #endif
+
+#ifdef CONFIG_MACH_OPENRD_ULTIMATE
+MACHINE_START(OPENRD_ULTIMATE, "Marvell OpenRD Ultimate Board")
+	/* Maintainer: Dhaval Vasa <dhaval.vasa@einfochips.com> */
+	.phys_io	= KIRKWOOD_REGS_PHYS_BASE,
+	.io_pg_offst	= ((KIRKWOOD_REGS_VIRT_BASE) >> 18) & 0xfffc,
+	.boot_params	= 0x00000100,
+	.init_machine	= openrd_init,
+	.map_io		= kirkwood_map_io,
+	.init_irq	= kirkwood_init_irq,
+	.timer		= &kirkwood_timer,
+MACHINE_END
+#endif
-- 
1.7.1

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

* [PATCH] Marvell OpenRD-Ultimate machine support
  2010-06-10  2:24 Dmytro Milinevskyy
@ 2010-06-10  5:50 ` Alexander Clouter
  2010-06-10  6:15   ` Dmytro Milinevskyy
  0 siblings, 1 reply; 16+ messages in thread
From: Alexander Clouter @ 2010-06-10  5:50 UTC (permalink / raw)
  To: linux-arm-kernel

Hi,

* Dmytro Milinevskyy <milinevskyy@gmail.com> [2010-06-10 05:24:56+0300]:
>
> [snipped]
>
> @@ -84,8 +90,7 @@ static void __init openrd_init(void)
>  
>  static int __init openrd_pci_init(void)
>  {
> -	if (machine_is_openrd_base() || machine_is_openrd_client())
> -		kirkwood_pcie_init();
> +	kirkwood_pcie_init();
>  
>  	return 0;
>  }
>
You just 'broke' kirkwood, welcome to the club.  We all have done this:

http://marc.info/?l=linux-arm-kernel&m=125624586625065&w=2
http://marc.info/?l=linux-arm-kernel&m=125804222219159&w=2

Put that 'if()' clause back in, the 'subsys_initcall(openrd_pci_init)' 
causes that code to run on *all* compiled in boards (think of the case 
where you have SheevaPlug's also enabled).

Cheers

-- 
Alexander Clouter
.sigmonster says: Poverty begins at home.

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

* [PATCH] Marvell OpenRD-Ultimate machine support
  2010-06-10  5:50 ` Alexander Clouter
@ 2010-06-10  6:15   ` Dmytro Milinevskyy
  0 siblings, 0 replies; 16+ messages in thread
From: Dmytro Milinevskyy @ 2010-06-10  6:15 UTC (permalink / raw)
  To: linux-arm-kernel

Hi!

You are right, I didn't notice that it's called via subsys_initcall.

-- Dima

On Thu, Jun 10, 2010 at 8:50 AM, Alexander Clouter <alex@digriz.org.uk> wrote:
> Hi,
>
> * Dmytro Milinevskyy <milinevskyy@gmail.com> [2010-06-10 05:24:56+0300]:
>>
>> [snipped]
>>
>> @@ -84,8 +90,7 @@ static void __init openrd_init(void)
>>
>> ?static int __init openrd_pci_init(void)
>> ?{
>> - ? ? if (machine_is_openrd_base() || machine_is_openrd_client())
>> - ? ? ? ? ? ? kirkwood_pcie_init();
>> + ? ? kirkwood_pcie_init();
>>
>> ? ? ? return 0;
>> ?}
>>
> You just 'broke' kirkwood, welcome to the club. ?We all have done this:
>
> http://marc.info/?l=linux-arm-kernel&m=125624586625065&w=2
> http://marc.info/?l=linux-arm-kernel&m=125804222219159&w=2
>
> Put that 'if()' clause back in, the 'subsys_initcall(openrd_pci_init)'
> causes that code to run on *all* compiled in boards (think of the case
> where you have SheevaPlug's also enabled).
>
> Cheers
>
> --
> Alexander Clouter
> .sigmonster says: Poverty begins at home.
>

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

* [PATCH] Marvell OpenRD-Ultimate machine support
@ 2010-06-10 19:12 Dmytro Milinevskyy
  2010-06-12  8:29 ` Lennert Buytenhek
  0 siblings, 1 reply; 16+ messages in thread
From: Dmytro Milinevskyy @ 2010-06-10 19:12 UTC (permalink / raw)
  To: linux-arm-kernel

Hi!
This patch adds support for the OpenRD Ultimate machine(could be found at http://www.arm.linux.org.uk/developer/machines/list.php?id=2884)

Besides adding machine description this patch adds correction for PHY address for Ultimate version.

Differences from the previous attempt:
 - Correctly filled instances of mv643xx_eth_platform_data in case of ultimate version.
 - Do PCIE initialization for Ultimate version along with Base and Client
 - Init ge01 if (!openrd-base) to make the code cleaner

Regards,

-- Dmytro Milinevskyy

Signed-off-by: Dmytro Milinevskyy <milinevskyy@gmail.com>
---
 arch/arm/mach-kirkwood/Kconfig        |    7 +++++++
 arch/arm/mach-kirkwood/openrd-setup.c |   27 ++++++++++++++++++++++++---
 2 files changed, 31 insertions(+), 3 deletions(-)

diff --git a/arch/arm/mach-kirkwood/Kconfig b/arch/arm/mach-kirkwood/Kconfig
index 29b2163..110a3b8 100644
--- a/arch/arm/mach-kirkwood/Kconfig
+++ b/arch/arm/mach-kirkwood/Kconfig
@@ -75,6 +75,13 @@ config MACH_OPENRD_CLIENT
 	  Say 'Y' here if you want your kernel to support the
 	  Marvell OpenRD Client Board.
 
+config MACH_OPENRD_ULTIMATE
+	bool "Marvell OpenRD Ultimate Board"
+	select MACH_OPENRD
+	help
+	  Say 'Y' here if you want your kernel to support the
+	  Marvell OpenRD Ultimate Board.
+
 config MACH_NETSPACE_V2
 	bool "LaCie Network Space v2 NAS Board"
 	help
diff --git a/arch/arm/mach-kirkwood/openrd-setup.c b/arch/arm/mach-kirkwood/openrd-setup.c
index ad3f1ec..284b00f 100644
--- a/arch/arm/mach-kirkwood/openrd-setup.c
+++ b/arch/arm/mach-kirkwood/openrd-setup.c
@@ -1,7 +1,7 @@
 /*
  * arch/arm/mach-kirkwood/openrd-setup.c
  *
- * Marvell OpenRD (Base|Client) Board Setup
+ * Marvell OpenRD (Base|Client|Ultimate) Board Setup
  *
  * This file is licensed under the terms of the GNU General Public
  * License version 2.  This program is licensed "as is" without any
@@ -73,9 +73,15 @@ static void __init openrd_init(void)
 
 	kirkwood_ehci_init();
 
+	if (machine_is_openrd_ultimate()) {
+		openrd_ge00_data.phy_addr = MV643XX_ETH_PHY_ADDR(0);
+		openrd_ge01_data.phy_addr = MV643XX_ETH_PHY_ADDR(1);
+	}
+
 	kirkwood_ge00_init(&openrd_ge00_data);
-	if (machine_is_openrd_client())
+	if (!machine_is_openrd_base())
 		kirkwood_ge01_init(&openrd_ge01_data);
+
 	kirkwood_sata_init(&openrd_sata_data);
 	kirkwood_sdio_init(&openrd_mvsdio_data);
 
@@ -84,7 +90,9 @@ static void __init openrd_init(void)
 
 static int __init openrd_pci_init(void)
 {
-	if (machine_is_openrd_base() || machine_is_openrd_client())
+	if (machine_is_openrd_base() ||
+		machine_is_openrd_client() ||
+		machine_is_openrd_ultimate())
 		kirkwood_pcie_init();
 
 	return 0;
@@ -116,3 +124,16 @@ MACHINE_START(OPENRD_CLIENT, "Marvell OpenRD Client Board")
 	.timer		= &kirkwood_timer,
 MACHINE_END
 #endif
+
+#ifdef CONFIG_MACH_OPENRD_ULTIMATE
+MACHINE_START(OPENRD_ULTIMATE, "Marvell OpenRD Ultimate Board")
+	/* Maintainer: Dhaval Vasa <dhaval.vasa@einfochips.com> */
+	.phys_io	= KIRKWOOD_REGS_PHYS_BASE,
+	.io_pg_offst	= ((KIRKWOOD_REGS_VIRT_BASE) >> 18) & 0xfffc,
+	.boot_params	= 0x00000100,
+	.init_machine	= openrd_init,
+	.map_io		= kirkwood_map_io,
+	.init_irq	= kirkwood_init_irq,
+	.timer		= &kirkwood_timer,
+MACHINE_END
+#endif
-- 
1.7.1

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

* [PATCH] Marvell OpenRD-Ultimate machine support
  2010-06-10 19:12 Dmytro Milinevskyy
@ 2010-06-12  8:29 ` Lennert Buytenhek
  0 siblings, 0 replies; 16+ messages in thread
From: Lennert Buytenhek @ 2010-06-12  8:29 UTC (permalink / raw)
  To: linux-arm-kernel

On Thu, Jun 10, 2010 at 10:12:55PM +0300, Dmytro Milinevskyy wrote:

> This patch adds support for the OpenRD Ultimate machine(could be found at http://www.arm.linux.org.uk/developer/machines/list.php?id=2884)

Acked-by: Lennert Buytenhek <buytenh@wantstofly.org>


> +MACHINE_START(OPENRD_ULTIMATE, "Marvell OpenRD Ultimate Board")
> +	/* Maintainer: Dhaval Vasa <dhaval.vasa@einfochips.com> */

I wonder whether this is correct, though.

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

end of thread, other threads:[~2010-06-12  8:29 UTC | newest]

Thread overview: 16+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2010-06-08 17:24 [PATCH] Marvell OpenRD-Ultimate machine support Dmytro Milinevskyy
2010-06-08 17:38 ` Joe Perches
2010-06-08 17:45 ` Lennert Buytenhek
  -- strict thread matches above, loose matches on Subject: below --
2010-06-08 19:47 Dmytro Milinevskyy
2010-06-09  7:25 ` Lennert Buytenhek
2010-06-09  7:37   ` Dmytro Milinevskyy
2010-06-09 20:14 Dmytro Milinevskyy
2010-06-09 20:37 ` Alexander Clouter
2010-06-09 20:39   ` Alexander Clouter
2010-06-09 20:42     ` Lennert Buytenhek
2010-06-10  1:56       ` Dmytro Milinevskyy
2010-06-10  2:24 Dmytro Milinevskyy
2010-06-10  5:50 ` Alexander Clouter
2010-06-10  6:15   ` Dmytro Milinevskyy
2010-06-10 19:12 Dmytro Milinevskyy
2010-06-12  8:29 ` Lennert Buytenhek

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).