[PATCH] final mv643xx_eth pegasos patch set ...

Sven Luther sven.luther at wanadoo.fr
Wed Mar 9 06:52:40 EST 2005


On Tue, Mar 08, 2005 at 08:28:05PM +0100, luther wrote:
> Hello,
> 
> Ok, thanks for your help, here is the final (hopefully) and cleaned up version
> of my patches :
> 
>   1) mv643xx-eth-pegasos.diff
>   This is the arch/ppc/platform diff, benh, could you look it over, and merge
>   it in ? It is not really usefull without the mv643xx_eth.c changes, but dale
>   is going to move those in together with his patches.
> 
>   2) linux-2.5-mv643xx-enet-pegasos.diff
>   This is just two small hunks against dale's linux-2.5-mv643xx-enet tree,
>   which include the SA_INTERRUPT -> SA_IRQ and the Kconfig change. Dale said
>   he would merge them with his stuff, hopefully for 2.6.12.
> 
>   3) mv643xx-eth.diff
>   This is the linux-2.5-mv643xx-enet diff against 2.6.11, together with the
>   linux-2.5-mv643xx-enet-pegasos.diff changes, for those who want to build
>   against 2.6.11.
> 
> So to build against the linux-2.5-mv643xx-enet tree, you need 1) and 2) and to
> build against 2.6.11 you need 1) and 3).
> 
> I am currently running the patches included in these changes, and will include
> them in the debian 2.6.11 kernels unless i hear otherwise. 

Oh well, with the patches this time :/

Friendly,

Sven Luther
-------------- next part --------------
--- linux-dale/arch/ppc/platforms/Makefile	2005-03-08 09:52:44.000000000 +0100
+++ kernel-source-2.6.11-marvell/arch/ppc/platforms/Makefile	2005-03-08 17:33:29.000000000 +0100
@@ -12,7 +12,7 @@
 obj-$(CONFIG_PPC_PMAC)		+= pmac_pic.o pmac_setup.o pmac_time.o \
 					pmac_feature.o pmac_pci.o pmac_sleep.o \
 					pmac_low_i2c.o pmac_cache.o
-obj-$(CONFIG_PPC_CHRP)		+= chrp_setup.o chrp_time.o chrp_pci.o
+obj-$(CONFIG_PPC_CHRP)		+= chrp_setup.o chrp_time.o chrp_pci.o mv643xx_eth_pegasos.o
 obj-$(CONFIG_PPC_PREP)		+= prep_pci.o prep_setup.o
 ifeq ($(CONFIG_PPC_PMAC),y)
 obj-$(CONFIG_NVRAM)		+= pmac_nvram.o
--- linux-dale/arch/ppc/platforms/mv643xx_eth_pegasos.c	1970-01-01 01:00:00.000000000 +0100
+++ kernel-source-2.6.11-marvell/arch/ppc/platforms/mv643xx_eth_pegasos.c	2005-03-08 20:21:33.000000000 +0100
@@ -0,0 +1,112 @@
+/*
+ *  arch/ppc/platforms/mv643xx_eth_pegasos.c
+ *
+ *  Copyright (C) 2005 Sven Luther <sl at bplan-gmbh.de> 
+ *  Thanks to :
+ *	Dale Farnsworth <dale at farnsworth.org>
+ *	Mark A. Greer <mgreer at mvista.com>
+ *	Nicolas DET <nd at bplan-gmbh.de>
+ *	Benjamin Herrenschmidt <benh at kernel.crashing.org>
+ *  And anyone else who helped me on this.
+ */
+
+#include <linux/types.h>
+#include <asm/prom.h>
+#include <linux/init.h>
+#include <linux/ioport.h>
+#include <linux/device.h>
+#include <linux/mv643xx.h>
+#include <linux/pci_ids.h>
+
+/* Pegasos 2 specific Marvell MV 64361 gigabit ethernet port setup */
+static struct resource mv643xx_eth_shared_resources[] = {
+	[0] = {
+		.name	= "ethernet shared base",
+		.start	= 0xf1000000 + MV643XX_ETH_SHARED_REGS,
+		.end	= 0xf1000000 + MV643XX_ETH_SHARED_REGS +
+					MV643XX_ETH_SHARED_REGS_SIZE - 1,
+		.flags	= IORESOURCE_MEM,
+	},
+};
+
+static struct platform_device mv643xx_eth_shared_device = {
+	.name		= MV643XX_ETH_SHARED_NAME,
+	.id		= 0,
+	.num_resources	= ARRAY_SIZE(mv643xx_eth_shared_resources),
+	.resource	= mv643xx_eth_shared_resources,
+};
+
+#ifdef CONFIG_MV643XX_ETH_0
+static struct resource mv643xx_eth0_resources[] = {
+	[0] = {
+		.name	= "eth0 irq",
+		.start	= 9,
+		.end	= 9,
+		.flags	= IORESOURCE_IRQ,
+	},
+};
+
+static struct mv643xx_eth_platform_data eth0_pd;
+
+static struct platform_device eth0_device = {
+	.name		= MV643XX_ETH_NAME,
+	.id		= 0,
+	.num_resources	= ARRAY_SIZE(mv643xx_eth0_resources),
+	.resource	= mv643xx_eth0_resources,
+	.dev = {
+		.platform_data = &eth0_pd,
+	},
+};
+#endif
+
+#ifdef CONFIG_MV643XX_ETH_1
+static struct resource mv643xx_eth1_resources[] = {
+	[0] = {
+		.name	= "eth1 irq",
+		.start	= 9,
+		.end	= 9,
+		.flags	= IORESOURCE_IRQ,
+	},
+};
+
+static struct mv643xx_eth_platform_data eth1_pd;
+
+static struct platform_device eth1_device = {
+	.name		= MV643XX_ETH_NAME,
+	.id		= 1,
+	.num_resources	= ARRAY_SIZE(mv643xx_eth1_resources),
+	.resource	= mv643xx_eth1_resources,
+	.dev = {
+		.platform_data = &eth1_pd,
+	},
+};
+#endif
+
+static struct platform_device *mv643xx_eth_pd_devs[] __initdata = {
+	&mv643xx_eth_shared_device,
+#ifdef CONFIG_MV643XX_ETH_0
+	&eth0_device,
+#endif
+#ifdef CONFIG_MV643XX_ETH_1
+	&eth1_device,
+#endif
+};
+
+static int __init
+mv643xx_eth_add_pds(void)
+{
+	int ret = 0;
+	struct device_node *np;
+	np = find_devices("host");
+	if (np != NULL) {
+		unsigned short *vendorid = (unsigned short *) get_property (np, "vendor-id", NULL);
+		unsigned short *deviceid = (unsigned short *) get_property (np, "device-id", NULL);
+		
+		if (vendorid && *vendorid == PCI_VENDOR_ID_MARVELL &&
+		    deviceid && *deviceid == PCI_DEVICE_ID_MARVELL_MV64360)
+			ret = platform_add_devices(mv643xx_eth_pd_devs,
+				ARRAY_SIZE(mv643xx_eth_pd_devs));
+	}
+	return ret;
+}
+arch_initcall(mv643xx_eth_add_pds);
-------------- next part --------------
--- linux-dale/arch/ppc/platforms/Makefile	2005-03-08 09:52:44.000000000 +0100
+++ kernel-source-2.6.11-marvell/arch/ppc/platforms/Makefile	2005-03-08 17:33:29.000000000 +0100
@@ -12,7 +12,7 @@
 obj-$(CONFIG_PPC_PMAC)		+= pmac_pic.o pmac_setup.o pmac_time.o \
 					pmac_feature.o pmac_pci.o pmac_sleep.o \
 					pmac_low_i2c.o pmac_cache.o
-obj-$(CONFIG_PPC_CHRP)		+= chrp_setup.o chrp_time.o chrp_pci.o
+obj-$(CONFIG_PPC_CHRP)		+= chrp_setup.o chrp_time.o chrp_pci.o mv643xx_eth_pegasos.o
 obj-$(CONFIG_PPC_PREP)		+= prep_pci.o prep_setup.o
 ifeq ($(CONFIG_PPC_PMAC),y)
 obj-$(CONFIG_NVRAM)		+= pmac_nvram.o
--- linux-dale/arch/ppc/platforms/mv643xx_eth_pegasos.c	1970-01-01 01:00:00.000000000 +0100
+++ kernel-source-2.6.11-marvell/arch/ppc/platforms/mv643xx_eth_pegasos.c	2005-03-08 20:21:33.000000000 +0100
@@ -0,0 +1,112 @@
+/*
+ *  arch/ppc/platforms/mv643xx_eth_pegasos.c
+ *
+ *  Copyright (C) 2005 Sven Luther <sl at bplan-gmbh.de> 
+ *  Thanks to :
+ *	Dale Farnsworth <dale at farnsworth.org>
+ *	Mark A. Greer <mgreer at mvista.com>
+ *	Nicolas DET <nd at bplan-gmbh.de>
+ *	Benjamin Herrenschmidt <benh at kernel.crashing.org>
+ *  And anyone else who helped me on this.
+ */
+
+#include <linux/types.h>
+#include <asm/prom.h>
+#include <linux/init.h>
+#include <linux/ioport.h>
+#include <linux/device.h>
+#include <linux/mv643xx.h>
+#include <linux/pci_ids.h>
+
+/* Pegasos 2 specific Marvell MV 64361 gigabit ethernet port setup */
+static struct resource mv643xx_eth_shared_resources[] = {
+	[0] = {
+		.name	= "ethernet shared base",
+		.start	= 0xf1000000 + MV643XX_ETH_SHARED_REGS,
+		.end	= 0xf1000000 + MV643XX_ETH_SHARED_REGS +
+					MV643XX_ETH_SHARED_REGS_SIZE - 1,
+		.flags	= IORESOURCE_MEM,
+	},
+};
+
+static struct platform_device mv643xx_eth_shared_device = {
+	.name		= MV643XX_ETH_SHARED_NAME,
+	.id		= 0,
+	.num_resources	= ARRAY_SIZE(mv643xx_eth_shared_resources),
+	.resource	= mv643xx_eth_shared_resources,
+};
+
+#ifdef CONFIG_MV643XX_ETH_0
+static struct resource mv643xx_eth0_resources[] = {
+	[0] = {
+		.name	= "eth0 irq",
+		.start	= 9,
+		.end	= 9,
+		.flags	= IORESOURCE_IRQ,
+	},
+};
+
+static struct mv643xx_eth_platform_data eth0_pd;
+
+static struct platform_device eth0_device = {
+	.name		= MV643XX_ETH_NAME,
+	.id		= 0,
+	.num_resources	= ARRAY_SIZE(mv643xx_eth0_resources),
+	.resource	= mv643xx_eth0_resources,
+	.dev = {
+		.platform_data = &eth0_pd,
+	},
+};
+#endif
+
+#ifdef CONFIG_MV643XX_ETH_1
+static struct resource mv643xx_eth1_resources[] = {
+	[0] = {
+		.name	= "eth1 irq",
+		.start	= 9,
+		.end	= 9,
+		.flags	= IORESOURCE_IRQ,
+	},
+};
+
+static struct mv643xx_eth_platform_data eth1_pd;
+
+static struct platform_device eth1_device = {
+	.name		= MV643XX_ETH_NAME,
+	.id		= 1,
+	.num_resources	= ARRAY_SIZE(mv643xx_eth1_resources),
+	.resource	= mv643xx_eth1_resources,
+	.dev = {
+		.platform_data = &eth1_pd,
+	},
+};
+#endif
+
+static struct platform_device *mv643xx_eth_pd_devs[] __initdata = {
+	&mv643xx_eth_shared_device,
+#ifdef CONFIG_MV643XX_ETH_0
+	&eth0_device,
+#endif
+#ifdef CONFIG_MV643XX_ETH_1
+	&eth1_device,
+#endif
+};
+
+static int __init
+mv643xx_eth_add_pds(void)
+{
+	int ret = 0;
+	struct device_node *np;
+	np = find_devices("host");
+	if (np != NULL) {
+		unsigned short *vendorid = (unsigned short *) get_property (np, "vendor-id", NULL);
+		unsigned short *deviceid = (unsigned short *) get_property (np, "device-id", NULL);
+		
+		if (vendorid && *vendorid == PCI_VENDOR_ID_MARVELL &&
+		    deviceid && *deviceid == PCI_DEVICE_ID_MARVELL_MV64360)
+			ret = platform_add_devices(mv643xx_eth_pd_devs,
+				ARRAY_SIZE(mv643xx_eth_pd_devs));
+	}
+	return ret;
+}
+arch_initcall(mv643xx_eth_add_pds);
-------------- next part --------------
A non-text attachment was scrubbed...
Name: mv643xx-eth.diff.gz
Type: application/octet-stream
Size: 39442 bytes
Desc: not available
URL: <http://lists.ozlabs.org/pipermail/linuxppc-dev/attachments/20050308/835482f1/attachment.obj>


More information about the Linuxppc-dev mailing list