diff -ruN linux-2.6.11.orig/arch/ppc/platforms/Makefile linux-2.6.11_nico2/arch/ppc/platforms/Makefile --- linux-2.6.11.orig/arch/ppc/platforms/Makefile 2005-03-02 08:38:33.000000000 +0100 +++ linux-2.6.11_nico2/arch/ppc/platforms/Makefile 2005-03-08 21:31:48.271036424 +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 -ruN linux-2.6.11.orig/arch/ppc/platforms/mv643xx_eth_pegasos.c linux-2.6.11_nico2/arch/ppc/platforms/mv643xx_eth_pegasos.c --- linux-2.6.11.orig/arch/ppc/platforms/mv643xx_eth_pegasos.c 1970-01-01 01:00:00.000000000 +0100 +++ linux-2.6.11_nico2/arch/ppc/platforms/mv643xx_eth_pegasos.c 2005-03-09 00:05:00.390235200 +0100 @@ -0,0 +1,125 @@ +/* + * arch/ppc/platforms/mv643xx_eth_pegasos.c + * + * Copyright (C) 2005 Sven Luther + * Thanks to : + * Dale Farnsworth + * Mark A. Greer + * Nicolas DET + * Benjamin Herrenschmidt + * And anyone else who helped me on this. + */ + +#include +#include +#include +#include +#include +#include +#include + +/* 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 = ð0_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 = ð1_pd, + }, +}; +#endif + +static struct platform_device *mv643xx_eth_pd_devs[] __initdata = { + &mv643xx_eth_shared_device, +#ifdef CONFIG_MV643XX_ETH_0 + ð0_device, +#endif +#ifdef CONFIG_MV643XX_ETH_1 + ð1_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_ptr = (unsigned short *) get_property (np, "vendor-id", NULL); + unsigned short *deviceid_ptr = (unsigned short *) get_property (np, "device-id", NULL); + + if (vendorid_ptr && deviceid_ptr) + { + unsigned short vendorid_val = *vendorid_ptr; + unsigned short deviceid_val = *deviceid_ptr; + + if (vendorid_val == 0) vendorid_val = (unsigned short) * ( (unsigned long *) vendorid_ptr); + if (deviceid_val == 0) deviceid_val = (unsigned short) * ( (unsigned long *) deviceid_ptr); + + if ( (vendorid_val == PCI_VENDOR_ID_MARVELL) && + (deviceid_val == 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);