···4846 return rc;4847}48480000000000000000000000000000000000000000000000000000000000000000000000000000000000004849static int __devinit cas_init_one(struct pci_dev *pdev,4850 const struct pci_device_id *ent)4851{···4984 if (pci_try_set_mwi(pdev))4985 printk(KERN_WARNING PFX "Could not enable MWI for %s\n",4986 pci_name(pdev));0049874988 /*4989 * On some architectures, the default cache line size set
···4846 return rc;4847}48484849+/* When this chip sits underneath an Intel 31154 bridge, it is the4850+ * only subordinate device and we can tweak the bridge settings to4851+ * reflect that fact.4852+ */4853+static void __devinit cas_program_bridge(struct pci_dev *cas_pdev)4854+{4855+ struct pci_dev *pdev = cas_pdev->bus->self;4856+ u32 val;4857+4858+ if (!pdev)4859+ return;4860+4861+ if (pdev->vendor != 0x8086 || pdev->device != 0x537c)4862+ return;4863+4864+ /* Clear bit 10 (Bus Parking Control) in the Secondary4865+ * Arbiter Control/Status Register which lives at offset4866+ * 0x41. Using a 32-bit word read/modify/write at 0x404867+ * is much simpler so that's how we do this.4868+ */4869+ pci_read_config_dword(pdev, 0x40, &val);4870+ val &= ~0x00040000;4871+ pci_write_config_dword(pdev, 0x40, val);4872+4873+ /* Max out the Multi-Transaction Timer settings since4874+ * Cassini is the only device present.4875+ *4876+ * The register is 16-bit and lives at 0x50. When the4877+ * settings are enabled, it extends the GRANT# signal4878+ * for a requestor after a transaction is complete. This4879+ * allows the next request to run without first needing4880+ * to negotiate the GRANT# signal back.4881+ *4882+ * Bits 12:10 define the grant duration:4883+ *4884+ * 1 -- 16 clocks4885+ * 2 -- 32 clocks4886+ * 3 -- 64 clocks4887+ * 4 -- 128 clocks4888+ * 5 -- 256 clocks4889+ *4890+ * All other values are illegal.4891+ *4892+ * Bits 09:00 define which REQ/GNT signal pairs get the4893+ * GRANT# signal treatment. We set them all.4894+ */4895+ pci_write_config_word(pdev, 0x50, (5 << 10) | 0x3ff);4896+4897+ /* The Read Prefecth Policy register is 16-bit and sits at4898+ * offset 0x52. It enables a "smart" pre-fetch policy. We4899+ * enable it and max out all of the settings since only one4900+ * device is sitting underneath and thus bandwidth sharing is4901+ * not an issue.4902+ *4903+ * The register has several 3 bit fields, which indicates a4904+ * multiplier applied to the base amount of prefetching the4905+ * chip would do. These fields are at:4906+ *4907+ * 15:13 --- ReRead Primary Bus4908+ * 12:10 --- FirstRead Primary Bus4909+ * 09:07 --- ReRead Secondary Bus4910+ * 06:04 --- FirstRead Secondary Bus4911+ *4912+ * Bits 03:00 control which REQ/GNT pairs the prefetch settings4913+ * get enabled on. Bit 3 is a grouped enabler which controls4914+ * all of the REQ/GNT pairs from [8:3]. Bits 2 to 0 control4915+ * the individual REQ/GNT pairs [2:0].4916+ */4917+ pci_write_config_word(pdev, 0x52,4918+ (0x7 << 13) |4919+ (0x7 << 10) |4920+ (0x7 << 7) |4921+ (0x7 << 4) |4922+ (0xf << 0));4923+4924+ /* Force cacheline size to 0x8 */4925+ pci_write_config_byte(pdev, PCI_CACHE_LINE_SIZE, 0x08);4926+4927+ /* Force latency timer to maximum setting so Cassini can4928+ * sit on the bus as long as it likes.4929+ */4930+ pci_write_config_byte(pdev, PCI_LATENCY_TIMER, 0xff);4931+}4932+4933static int __devinit cas_init_one(struct pci_dev *pdev,4934 const struct pci_device_id *ent)4935{···4900 if (pci_try_set_mwi(pdev))4901 printk(KERN_WARNING PFX "Could not enable MWI for %s\n",4902 pci_name(pdev));4903+4904+ cas_program_bridge(pdev);49054906 /*4907 * On some architectures, the default cache line size set