r2649 - trunk/kernel/source/kernel-source-2.6.11-2.6.11/debian/patches

Sven Luther luther@costa.debian.org
Tue, 08 Mar 2005 17:42:05 +0100


Author: luther
Date: 2005-03-08 17:42:03 +0100 (Tue, 08 Mar 2005)
New Revision: 2649

Modified:
   trunk/kernel/source/kernel-source-2.6.11-2.6.11/debian/patches/powerpc-pegasos-marvell.dpatch
Log:
Hopefully the final version of the patch.


Modified: trunk/kernel/source/kernel-source-2.6.11-2.6.11/debian/patches/powerpc-pegasos-marvell.dpatch
===================================================================
--- trunk/kernel/source/kernel-source-2.6.11-2.6.11/debian/patches/powerpc-pegasos-marvell.dpatch	2005-03-08 14:07:23 UTC (rev 2648)
+++ trunk/kernel/source/kernel-source-2.6.11-2.6.11/debian/patches/powerpc-pegasos-marvell.dpatch	2005-03-08 16:42:03 UTC (rev 2649)
@@ -2,23 +2,89 @@
 ##
 ## All lines beginning with `## DP:' are a description of the patch.
 ## DP: Description: Add MV64xxx_eth powerpc support
-## DP: Patch authors: Dale Farnsworth <dale@farnsworth.org>, Nicolas DET <nd@bplan-gmbh.de>
-## DP: Upstream status: being submitted in the next few days.
+## DP: Patch authors: Dale Farnsworth <dale@farnsworth.org>
+## DP: Patch authors: Nicolas DET <nd@bplan-gmbh.de>
+## DP: Patch authors: Sven Luther <sl@bplan-gmbh.de>
+## DP: Upstream status: planned for 2.6.12, not yet submitted though.
 ## DP: BK URL: bk://dfarnsworth.bkbits.net/linux-2.5-mv643xx-enet
 
 . $(dirname $0)/DPATCH
 
 @DPATCH@
-diff -Nur kernel-source-2.6.11/arch/ppc/platforms/chrp_setup.c kernel-source-2.6.11-marvell/arch/ppc/platforms/chrp_setup.c
---- kernel-source-2.6.11/arch/ppc/platforms/chrp_setup.c	2005-03-02 08:38:25.000000000 +0100
-+++ kernel-source-2.6.11-marvell/arch/ppc/platforms/chrp_setup.c	2005-03-08 07:37:10.000000000 +0100
-@@ -217,6 +217,95 @@
- 	}
- }
- 
+diff -urN kernel-source-2.6.11/arch/ppc/platforms/Makefile kernel-source-2.6.11-marvell/arch/ppc/platforms/Makefile
+--- kernel-source-2.6.11/arch/ppc/platforms/Makefile	2005-03-02 08:38:33.000000000 +0100
++++ kernel-source-2.6.11-marvell/arch/ppc/platforms/Makefile	2005-03-08 17:33:29.346601584 +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
+diff -urN kernel-source-2.6.11/arch/ppc/platforms/mv643xx_eth_pegasos.c kernel-source-2.6.11-marvell/arch/ppc/platforms/mv643xx_eth_pegasos.c
+--- kernel-source-2.6.11/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 17:33:20.482949064 +0100
+@@ -0,0 +1,163 @@
++/*
++ *  arch/ppc/platforms/mv643xx_eth_pegasos.c
++ *
++ *  Copyright (C) 2005 Sven Luther <sl@bplan-gmbh.de> 
++ *  Well, Dale more probably, but i guess he will fix that when merging his code.
++ *
++ */
++
++/* I guess most of those can be dropped, but well */
++#include <linux/config.h>
++#include <linux/errno.h>
++#include <linux/sched.h>
++#include <linux/kernel.h>
++#include <linux/mm.h>
++#include <linux/stddef.h>
++#include <linux/ptrace.h>
++#include <linux/slab.h>
++#include <linux/user.h>
++#include <linux/a.out.h>
++#include <linux/tty.h>
++#include <linux/major.h>
++#include <linux/interrupt.h>
++#include <linux/reboot.h>
++#include <linux/pci.h>
++#include <linux/version.h>
++#include <linux/adb.h>
++#include <linux/module.h>
++#include <linux/delay.h>
++#include <linux/ide.h>
++#include <linux/irq.h>
++#include <linux/console.h>
++#include <linux/seq_file.h>
++#include <linux/root_dev.h>
++#include <linux/initrd.h>
++#include <linux/module.h>
++
++#include <asm/io.h>
++#include <asm/pgtable.h>
++#include <asm/gg2.h>
++#include <asm/pci-bridge.h>
++#include <asm/dma.h>
++#include <asm/machdep.h>
++#include <asm/irq.h>
++#include <asm/hydra.h>
++#include <asm/sections.h>
++#include <asm/time.h>
++#include <asm/btext.h>
++#include <asm/i8259.h>
++#include <asm/open_pic.h>
++#include <asm/xmon.h>
++
++#include <asm/prom.h>
++#include <linux/init.h>
++#include <linux/ioport.h>
++#include <linux/device.h>
++#include <linux/mv643xx.h>
++
 +/* Pegasos 2 specific Marvell MV 64361 gigabit ethernet port setup */
-+#ifdef CONFIG_MV643XX_ETH
-+#include <linux/mv643xx.h>
 +static struct resource mv643xx_eth_shared_resources[] = {
 +	[0] = {
 +		.name	= "ethernet shared base",
@@ -95,28 +161,36 @@
 +static int __init
 +mv643xx_eth_add_pds(void)
 +{
-+	int ret;
-+	if ((_machine == _MACH_chrp) && (_chrp_type == _CHRP_Pegasos))
-+		ret = platform_add_devices(mv643xx_eth_pd_devs,
-+			ARRAY_SIZE(mv643xx_eth_pd_devs));
-+	else
-+		ret = 0;
++	int ret = 0;
++	struct device_node *np;
++	printk ("SVEN -- Pegasos marvell stuff init ...\n");
++	np = find_devices("host");
++#ifdef CONFIG_MV643XX_ETH_0
++	printk ("SVEN -- ethernet port 0 enabled\n");
++#endif
++#ifdef CONFIG_MV643XX_ETH_1
++	printk ("SVEN -- ethernet port 1 enabled\n");
++#endif
++	if (np != NULL) {
++		unsigned int *vendorid = (unsigned short *) get_property (np, "vendor-id", NULL);
++		unsigned int *deviceid = (unsigned short *) get_property (np, "device-id", NULL);
++		
++		if (vendorid && *vendorid == 0x11ab && deviceid && *deviceid == 0x6460) {
++			printk ("SVEN -- Marvell MV6436x detected\n");
++			ret = platform_add_devices(mv643xx_eth_pd_devs,
++				ARRAY_SIZE(mv643xx_eth_pd_devs));
++		} else {
++			printk ("SVEN -- no Marvell MV6436x found (host is %04x, %04x)\n",
++				vendorid ? *vendorid : 0, deviceid ? *deviceid : 0);
++		}
++	} else {
++		printk ("SVEN -- no host node found\n");
++	}
++	printk ("SVEN -- ret = %d\n", ret);
 +	return ret;
 +}
 +arch_initcall(mv643xx_eth_add_pds);
-+#endif
- 
- static void __init pegasos_set_l2cr(void)
- {
-@@ -244,6 +333,7 @@
- 	}
- }
- 
-+
- void __init chrp_setup_arch(void)
- {
- 	struct device_node *device;
-diff -Nur kernel-source-2.6.11/drivers/net/Kconfig kernel-source-2.6.11-marvell/drivers/net/Kconfig
+diff -urN kernel-source-2.6.11/drivers/net/Kconfig kernel-source-2.6.11-marvell/drivers/net/Kconfig
 --- kernel-source-2.6.11/drivers/net/Kconfig	2005-03-02 08:38:25.000000000 +0100
 +++ kernel-source-2.6.11-marvell/drivers/net/Kconfig	2005-03-07 20:36:43.000000000 +0100
 @@ -2094,10 +2094,11 @@
@@ -133,7 +207,7 @@
  
  config MV643XX_ETH_0
  	bool "MV-643XX Port 0"
-diff -Nur kernel-source-2.6.11/drivers/net/mv643xx_eth.c kernel-source-2.6.11-marvell/drivers/net/mv643xx_eth.c
+diff -urN kernel-source-2.6.11/drivers/net/mv643xx_eth.c kernel-source-2.6.11-marvell/drivers/net/mv643xx_eth.c
 --- kernel-source-2.6.11/drivers/net/mv643xx_eth.c	2005-03-02 08:38:01.000000000 +0100
 +++ kernel-source-2.6.11-marvell/drivers/net/mv643xx_eth.c	2005-03-08 09:21:11.000000000 +0100
 @@ -1,5 +1,5 @@
@@ -196,7 +270,7 @@
  #include <asm/system.h>
 +#include <asm/delay.h>
 +#ifdef PPC_MULTIPLATEFORM
-+#include <linux/mv643xx.h>
++#include <mv64x60.h>
 +#endif
  #include "mv643xx_eth.h"
  
@@ -4156,7 +4230,7 @@
 +};
 +
 +/************* End ethtool support *************************/
-diff -Nur kernel-source-2.6.11/drivers/net/mv643xx_eth.h kernel-source-2.6.11-marvell/drivers/net/mv643xx_eth.h
+diff -urN kernel-source-2.6.11/drivers/net/mv643xx_eth.h kernel-source-2.6.11-marvell/drivers/net/mv643xx_eth.h
 --- kernel-source-2.6.11/drivers/net/mv643xx_eth.h	2005-03-02 08:38:09.000000000 +0100
 +++ kernel-source-2.6.11-marvell/drivers/net/mv643xx_eth.h	2005-03-08 10:09:01.000000000 +0100
 @@ -1,5 +1,5 @@
@@ -4939,7 +5013,7 @@
  
 -#endif  /* __MV64340_ETH_H__ */
 +#endif				/* __MV643XX_ETH_H__ */
-diff -Nur kernel-source-2.6.11/include/linux/mv643xx.h kernel-source-2.6.11-marvell/include/linux/mv643xx.h
+diff -urN kernel-source-2.6.11/include/linux/mv643xx.h kernel-source-2.6.11-marvell/include/linux/mv643xx.h
 --- kernel-source-2.6.11/include/linux/mv643xx.h	2005-03-02 08:38:18.000000000 +0100
 +++ kernel-source-2.6.11-marvell/include/linux/mv643xx.h	2005-03-08 10:08:28.000000000 +0100
 @@ -1,5 +1,5 @@