Index: superio/winbond/w83627hf/pnp.dts
===================================================================
--- superio/winbond/w83627hf/pnp.dts	(revision 0)
+++ superio/winbond/w83627hf/pnp.dts	(revision 0)
@@ -0,0 +1,29 @@
+/*
+ * This file is part of the coreboot project.
+ *
+ * Copyright (C) 2007 Ronald G. Minnich <rminnich@gmail.com>
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301 USA
+ */
+
+{
+	/* To override any of these, put the over-ride in mainboard dts. */
+	io = "0";
+	io2 = "0";
+	irq = "0";
+	irq2 = "0";
+	drq = "0";
+	drq2 = "0";
+};
Index: superio/winbond/w83627hf/superio.c
===================================================================
--- superio/winbond/w83627hf/superio.c	(revision 987)
+++ superio/winbond/w83627hf/superio.c	(working copy)
@@ -117,32 +117,31 @@
 {
 	struct superio_winbond_w83627hf_dts_config *conf;
 	struct resource *res0, *res1;
-	struct pc_keyboard keyboard;
 
-#if 1
-	printk(BIOS_ERR, "dummy init XXXX\n");
-#endif
-
+	printk(BIOS_DEBUG, "%s: %s\n",__func__, dev->dtsname);
 	if (!dev->enabled) {
+		printk(BIOS_ERR, "dummy init XXXX\n");
 		return;
 	}
 
 	conf = dev->device_configuration;
 	switch(dev->path.pnp.device) {
 	case W83627HF_SP1:
+		printk(BIOS_DEBUG, "%s: Hey com1 is enabled.\n",__func__);
 		res0 = find_resource(dev, PNP_IDX_IO0);
 #warning init_uart8250
-		//init_uart8250(res0->base, &conf->com1);
+		printk(BIOS_DEBUG, "%s: Not calling init_uart8250.\n",__func__);
 		break;
 	case W83627HF_SP2:
 		res0 = find_resource(dev, PNP_IDX_IO0);
 #warning init_uart8250
+		printk(BIOS_DEBUG, "%s: Not calling init_uart8250.\n",__func__);
 		//init_uart8250(res0->base, &conf->com2);
 		break;
 	case W83627HF_KBC:
 		res0 = find_resource(dev, PNP_IDX_IO0);
 		res1 = find_resource(dev, PNP_IDX_IO1);
-		init_pc_keyboard(res0->base, res1->base, &keyboard);
+		init_pc_keyboard(res0->base, res1->base, NULL);
 		break;
 	case W83627HF_HWM:
 		res0 = find_resource(dev, PNP_IDX_IO0);
@@ -190,7 +189,9 @@
 	}
 }
 static void phase3_chip_setup_dev(struct device *dev);
+
 struct device_operations w83627hf_ops = {
+	.id = {.type = DEVICE_ID_PNP},
 	.phase3_chip_setup_dev   = phase3_chip_setup_dev,
 	.phase3_enable           = w83627hf_pnp_enable_resources,
 	.phase4_read_resources   = pnp_read_resources,
@@ -217,6 +218,13 @@
 
 static void phase3_chip_setup_dev(struct device *dev)
 {
+	struct device *child = dev->link[0].children;
+	
+	while (dev->links && child) {
+		if (child->path.type ==  DEVICE_PATH_PNP)
+			child->path.pnp.port = dev->path.ioport.iobase;
+		child = child->sibling;
+	}
 	pnp_enable_devices(dev, &w83627hf_ops, ARRAY_SIZE(pnp_dev_info), pnp_dev_info);
 }
 
Index: superio/winbond/w83627hf/dts
===================================================================
--- superio/winbond/w83627hf/dts	(revision 987)
+++ superio/winbond/w83627hf/dts	(working copy)
@@ -22,65 +22,4 @@
 	device_operations = "w83627hf_ops";
 	/* To override any of these, put the over-ride in mainboard dts. */
 
-	/* Floppy */
-	floppydev = "0x0";
-	floppyenable = "0";
-	floppyio = "0x3f0";
-	floppyirq = "0x60";
-	floppydrq = "0x02";
-
-	/* Parallel port */
-	ppdev = "2";
-	ppenable = "0";
-	ppio = "0x378";
-	ppirq = "7";
-
-	/* COM1 */
-	com1dev = "2";
-	com1enable = "0";
-	com1io = "0x3f8";
-	com1irq = "4";
-
-	/* COM2 */
-	com2dev = "3";
-	com2enable = "0";
-	com2io = "0x2f8";
-	com2irq = "3";
-
-	/* Keyboard */
-	kbdev = "5";
-	kbenable = "0";
-	kbio = "0x60";
-	kbio2 = "0x62";
-	kbirq = "1";
-	kbirq2 = "12";
-
-	/* Consumer IR */
-	cirdev = "6";
-	cirenable = "0";
-
-	/* Game port */
-	gamedev = "7";
-	gameenable = "0";
-	gameio = "0x220";
-	gameio2 = "0x400";
-	gameirq = "9";
-
-	/* GPIO2 */
-	gpio2dev = "8";
-	gpio2enable = "0";
-
-	/* GPIO3 */
-	gpio3dev = "9";
-	gpio3enable = "0";
-
-	/* ACPI */
-	acpidev = "0xa";
-	acpienable = "0";
-
-	/* Hardware Monitor */
-	hwmdev = "0xb";
-	hwmenable = "0";
-	hwmio = "0x290";
-	hwmirq = "5";
 };
Index: mainboard/amd/serengeti/dts
===================================================================
--- mainboard/amd/serengeti/dts	(revision 987)
+++ mainboard/amd/serengeti/dts	(working copy)
@@ -29,7 +29,10 @@
 		/config/("northbridge/amd/k8/domain");
 		pci0@18,0 {
 			/config/("northbridge/amd/k8/pci");
-			pci@0,0 {
+			ht@a,0 {
+				/config/("southbridge/amd/amd8132/pcix.dts");
+			};
+			ht@6,0 {
 				/config/("southbridge/amd/amd8111/pci.dts");
 				pci@0,0{
 					/config/("southbridge/amd/amd8111/usb.dts");
@@ -39,18 +42,43 @@
 				};
 				pci@0,2{
 					/config/("southbridge/amd/amd8111/usb2.dts");
-					disable;
+					disabled;
 				};
 				pci@1,0{
 					/config/("southbridge/amd/amd8111/nic.dts");
-					disable;
+					disabled;
 				};
 			};
 			pci@1,0 {
 				/config/("southbridge/amd/amd8111/lpc.dts");
+				ioport@2e {
+					/config/("superio/winbond/w83627hf/dts");
+					pnp@2 {
+						/config/("superio/winbond/w83627hf/pnp.dts");
+						enabled;
+						io = "0x3f8";
+						irq = "4";
+					};
+					pnp@5 {
+						/config/("superio/winbond/w83627hf/pnp.dts");
+						enabled;
+						io = "0x60";
+						io2 = "0x62";
+						irq = "1";
+						irq2 = "12";
+					};
+					pnp@a {
+						/config/("superio/winbond/w83627hf/pnp.dts");
+						enabled;
+						io = "0x290";
+						irq = "5";
+					};
+				};
 			};
 			pci@1,1 {
 				/config/("southbridge/amd/amd8111/ide.dts");
+				ide0_enable = "1";
+				ide1_enable = "1";
 			};
 			pci@1,2 {
 				/config/("southbridge/amd/amd8111/smbus.dts");
@@ -60,26 +88,18 @@
 			};
 			pci@1,5 {
 				/config/("southbridge/amd/amd8111/ac97audio.dts");
+				disabled;
 			};
 			pci@1,6 {
 				/config/("southbridge/amd/amd8111/ac97modem.dts");
+				disabled;
 			};
-			pci@2,0 {
-				/config/("southbridge/amd/amd8132/pcix.dts");
+			pci@1,7 {
+				disabled;
 			};
 		};
-		pci1@18,0 {
-			/config/("northbridge/amd/k8/pci");
-		};
-		pci2@18,0 {
-			/config/("northbridge/amd/k8/pci");
-		};
 		pci@18,1 {};
 		pci@18,2 {};
 		pci@18,3 {};
-		ioport@2e {
-			/config/("superio/winbond/w83627hf/dts");
-			com1enable = "1";
-		};
 	};
 };
Index: device/pnp_device.c
===================================================================
--- device/pnp_device.c	(revision 987)
+++ device/pnp_device.c	(working copy)
@@ -85,6 +85,9 @@
 
 static void pnp_set_resource(struct device *dev, struct resource *resource)
 {
+	printk(BIOS_SPEW,
+	       "%s: %s %02lx %s\n",
+	       __func__, dev_path(dev), resource->index, resource_type(resource));
 	if (!(resource->flags & IORESOURCE_ASSIGNED)) {
 		printk(BIOS_ERR,
 		       "ERROR: %s %02lx %s size: 0x%010llx not assigned\n",
@@ -158,6 +161,8 @@
 	/* Initialize the resource. */
 	resource->limit = 0xffff;
 	resource->flags |= IORESOURCE_IO;
+	resource->flags |= IORESOURCE_ASSIGNED;
+	resource->flags |= IORESOURCE_FIXED;
 
 	/* Get the resource size. */
 	moving = info->mask;
@@ -233,17 +238,29 @@
 			unsigned int functions, struct pnp_info *info)
 {
 	struct device_path path;
-	struct device_id id = {.type = DEVICE_ID_PNP };
 	struct device *dev;
 	int i;
 
+	void resource_tree(struct device *dev, int depth);
+
 	path.type = DEVICE_PATH_PNP;
 	path.pnp.port = base_dev->path.pnp.port;
 
+	printk(BIOS_DEBUG,"%s: find_devs base %s PNP port %02x (%d functions.)\n",
+		__func__,base_dev->dtsname,base_dev->path.pnp.port, functions);
 	/* Setup the ops and resources on the newly allocated devices. */
 	for (i = 0; i < functions; i++) {
 		path.pnp.device = info[i].function;
-		dev = alloc_find_dev(base_dev->bus, &path, &id);
+		printk(BIOS_DEBUG,"  find_dev %02x.\n", info[i].function);
+		dev = find_dev_path(&base_dev->link[0], &path);
+		printk(BIOS_DEBUG,"%s: find_dev returns %s(%s).\n",
+			__func__,dev?dev->dtsname:"NULL",dev?dev_path(dev):"");
+		if (!dev) {
+			printk(BIOS_ERR,"No device at PNP port %02x function %x.\n",
+				base_dev->path.pnp.port, info[i].function);
+			continue;
+		}
+		
 
 		/* Don't initialize a device multiple times. */
 		if (dev->ops)
@@ -255,5 +272,8 @@
 			dev->ops = info[i].ops;
 		}
 		get_resources(dev, &info[i]);
+		
 	}
+	printk(BIOS_DEBUG,"%s: device %s\n",__func__, base_dev->dtsname);
+	resource_tree(base_dev,0);
 }
