patch-2.2.4 linux/arch/sparc64/kernel/ebus.c

Next file: linux/arch/sparc64/kernel/entry.S
Previous file: linux/arch/sparc64/kernel/dtlb_prot.S
Back to the patch index
Back to the overall index

diff -u --recursive --new-file v2.2.3/linux/arch/sparc64/kernel/ebus.c linux/arch/sparc64/kernel/ebus.c
@@ -1,4 +1,4 @@
-/* $Id: ebus.c,v 1.33 1998/09/21 05:06:03 jj Exp $
+/* $Id: ebus.c,v 1.35 1999/01/26 14:34:11 jj Exp $
  * ebus.c: PCI to EBus bridge device.
  *
  * Copyright (C) 1997  Eddie C. Dost  (ecd@skynet.be)
@@ -263,6 +263,31 @@
 	ebus->next = 0;
 
 	while (ebusnd) {
+		/* SUNW,pci-qfe uses four empty ebuses on it.
+		   I think we should not consider them here,
+		   as they have half of the properties this
+		   code expects and once we do PCI hot-plug,
+		   we'd have to tweak with the ebus_chain
+		   in the runtime after initialization. -jj */
+		if (!prom_getchild (ebusnd)) {
+			pdev = pci_find_device(PCI_VENDOR_ID_SUN, 
+					       PCI_DEVICE_ID_SUN_EBUS, pdev);
+			if (!pdev) {
+				if (ebus == ebus_chain) {
+					ebus_chain = NULL;
+					printk("ebus: No EBus's found.\n");
+#ifdef PROM_DEBUG
+					dprintf("ebus: No EBus's found.\n");
+#endif
+					return;
+				}
+				break;
+			}
+			
+			cookie = pdev->sysdata;
+			ebusnd = cookie->prom_node;
+			continue;
+		}
 		printk("ebus%d:", num_ebus);
 #ifdef PROM_DEBUG
 		dprintf("ebus%d:", num_ebus);
@@ -279,6 +304,12 @@
 		pci_read_config_word(pdev, PCI_COMMAND, &pci_command);
 		pci_command |= PCI_COMMAND_MASTER;
 		pci_write_config_word(pdev, PCI_COMMAND, pci_command);
+
+		/* Set reasonable cache line size and latency timer values. */
+		pci_write_config_byte(pdev, PCI_LATENCY_TIMER, 64);
+
+		/* NOTE: Cache line size is in 32-bit word units. */
+		pci_write_config_byte(pdev, PCI_CACHE_LINE_SIZE, 0x10);
 
 		len = prom_getproperty(ebusnd, "reg", (void *)regs,
 				       sizeof(regs));

FUNET's LINUX-ADM group, linux-adm@nic.funet.fi
TCL-scripts by Sam Shen (who was at: slshen@lbl.gov)