···48464846 return rc;48474847}4848484848494849+/* When this chip sits underneath an Intel 31154 bridge, it is the48504850+ * only subordinate device and we can tweak the bridge settings to48514851+ * reflect that fact.48524852+ */48534853+static void __devinit cas_program_bridge(struct pci_dev *cas_pdev)48544854+{48554855+ struct pci_dev *pdev = cas_pdev->bus->self;48564856+ u32 val;48574857+48584858+ if (!pdev)48594859+ return;48604860+48614861+ if (pdev->vendor != 0x8086 || pdev->device != 0x537c)48624862+ return;48634863+48644864+ /* Clear bit 10 (Bus Parking Control) in the Secondary48654865+ * Arbiter Control/Status Register which lives at offset48664866+ * 0x41. Using a 32-bit word read/modify/write at 0x4048674867+ * is much simpler so that's how we do this.48684868+ */48694869+ pci_read_config_dword(pdev, 0x40, &val);48704870+ val &= ~0x00040000;48714871+ pci_write_config_dword(pdev, 0x40, val);48724872+48734873+ /* Max out the Multi-Transaction Timer settings since48744874+ * Cassini is the only device present.48754875+ *48764876+ * The register is 16-bit and lives at 0x50. When the48774877+ * settings are enabled, it extends the GRANT# signal48784878+ * for a requestor after a transaction is complete. This48794879+ * allows the next request to run without first needing48804880+ * to negotiate the GRANT# signal back.48814881+ *48824882+ * Bits 12:10 define the grant duration:48834883+ *48844884+ * 1 -- 16 clocks48854885+ * 2 -- 32 clocks48864886+ * 3 -- 64 clocks48874887+ * 4 -- 128 clocks48884888+ * 5 -- 256 clocks48894889+ *48904890+ * All other values are illegal.48914891+ *48924892+ * Bits 09:00 define which REQ/GNT signal pairs get the48934893+ * GRANT# signal treatment. We set them all.48944894+ */48954895+ pci_write_config_word(pdev, 0x50, (5 << 10) | 0x3ff);48964896+48974897+ /* The Read Prefecth Policy register is 16-bit and sits at48984898+ * offset 0x52. It enables a "smart" pre-fetch policy. We48994899+ * enable it and max out all of the settings since only one49004900+ * device is sitting underneath and thus bandwidth sharing is49014901+ * not an issue.49024902+ *49034903+ * The register has several 3 bit fields, which indicates a49044904+ * multiplier applied to the base amount of prefetching the49054905+ * chip would do. These fields are at:49064906+ *49074907+ * 15:13 --- ReRead Primary Bus49084908+ * 12:10 --- FirstRead Primary Bus49094909+ * 09:07 --- ReRead Secondary Bus49104910+ * 06:04 --- FirstRead Secondary Bus49114911+ *49124912+ * Bits 03:00 control which REQ/GNT pairs the prefetch settings49134913+ * get enabled on. Bit 3 is a grouped enabler which controls49144914+ * all of the REQ/GNT pairs from [8:3]. Bits 2 to 0 control49154915+ * the individual REQ/GNT pairs [2:0].49164916+ */49174917+ pci_write_config_word(pdev, 0x52,49184918+ (0x7 << 13) |49194919+ (0x7 << 10) |49204920+ (0x7 << 7) |49214921+ (0x7 << 4) |49224922+ (0xf << 0));49234923+49244924+ /* Force cacheline size to 0x8 */49254925+ pci_write_config_byte(pdev, PCI_CACHE_LINE_SIZE, 0x08);49264926+49274927+ /* Force latency timer to maximum setting so Cassini can49284928+ * sit on the bus as long as it likes.49294929+ */49304930+ pci_write_config_byte(pdev, PCI_LATENCY_TIMER, 0xff);49314931+}49324932+48494933static int __devinit cas_init_one(struct pci_dev *pdev,48504934 const struct pci_device_id *ent)48514935{···49844900 if (pci_try_set_mwi(pdev))49854901 printk(KERN_WARNING PFX "Could not enable MWI for %s\n",49864902 pci_name(pdev));49034903+49044904+ cas_program_bridge(pdev);4987490549884906 /*49894907 * On some architectures, the default cache line size set