@@ -344,57 +344,6 @@ static void pci_read_bases(struct pci_dev *dev, unsigned int howmany, int rom)
344
344
}
345
345
}
346
346
347
- static void pci_read_bridge_windows (struct pci_dev * bridge )
348
- {
349
- u16 io ;
350
- u32 pmem , tmp ;
351
-
352
- pci_read_config_word (bridge , PCI_IO_BASE , & io );
353
- if (!io ) {
354
- pci_write_config_word (bridge , PCI_IO_BASE , 0xe0f0 );
355
- pci_read_config_word (bridge , PCI_IO_BASE , & io );
356
- pci_write_config_word (bridge , PCI_IO_BASE , 0x0 );
357
- }
358
- if (io )
359
- bridge -> io_window = 1 ;
360
-
361
- /*
362
- * DECchip 21050 pass 2 errata: the bridge may miss an address
363
- * disconnect boundary by one PCI data phase. Workaround: do not
364
- * use prefetching on this device.
365
- */
366
- if (bridge -> vendor == PCI_VENDOR_ID_DEC && bridge -> device == 0x0001 )
367
- return ;
368
-
369
- pci_read_config_dword (bridge , PCI_PREF_MEMORY_BASE , & pmem );
370
- if (!pmem ) {
371
- pci_write_config_dword (bridge , PCI_PREF_MEMORY_BASE ,
372
- 0xffe0fff0 );
373
- pci_read_config_dword (bridge , PCI_PREF_MEMORY_BASE , & pmem );
374
- pci_write_config_dword (bridge , PCI_PREF_MEMORY_BASE , 0x0 );
375
- }
376
- if (!pmem )
377
- return ;
378
-
379
- bridge -> pref_window = 1 ;
380
-
381
- if ((pmem & PCI_PREF_RANGE_TYPE_MASK ) == PCI_PREF_RANGE_TYPE_64 ) {
382
-
383
- /*
384
- * Bridge claims to have a 64-bit prefetchable memory
385
- * window; verify that the upper bits are actually
386
- * writable.
387
- */
388
- pci_read_config_dword (bridge , PCI_PREF_BASE_UPPER32 , & pmem );
389
- pci_write_config_dword (bridge , PCI_PREF_BASE_UPPER32 ,
390
- 0xffffffff );
391
- pci_read_config_dword (bridge , PCI_PREF_BASE_UPPER32 , & tmp );
392
- pci_write_config_dword (bridge , PCI_PREF_BASE_UPPER32 , pmem );
393
- if (tmp )
394
- bridge -> pref_64_window = 1 ;
395
- }
396
- }
397
-
398
347
static void pci_read_bridge_io (struct pci_bus * child )
399
348
{
400
349
struct pci_dev * dev = child -> self ;
@@ -510,6 +459,57 @@ static void pci_read_bridge_mmio_pref(struct pci_bus *child)
510
459
}
511
460
}
512
461
462
+ static void pci_read_bridge_windows (struct pci_dev * bridge )
463
+ {
464
+ u16 io ;
465
+ u32 pmem , tmp ;
466
+
467
+ pci_read_config_word (bridge , PCI_IO_BASE , & io );
468
+ if (!io ) {
469
+ pci_write_config_word (bridge , PCI_IO_BASE , 0xe0f0 );
470
+ pci_read_config_word (bridge , PCI_IO_BASE , & io );
471
+ pci_write_config_word (bridge , PCI_IO_BASE , 0x0 );
472
+ }
473
+ if (io )
474
+ bridge -> io_window = 1 ;
475
+
476
+ /*
477
+ * DECchip 21050 pass 2 errata: the bridge may miss an address
478
+ * disconnect boundary by one PCI data phase. Workaround: do not
479
+ * use prefetching on this device.
480
+ */
481
+ if (bridge -> vendor == PCI_VENDOR_ID_DEC && bridge -> device == 0x0001 )
482
+ return ;
483
+
484
+ pci_read_config_dword (bridge , PCI_PREF_MEMORY_BASE , & pmem );
485
+ if (!pmem ) {
486
+ pci_write_config_dword (bridge , PCI_PREF_MEMORY_BASE ,
487
+ 0xffe0fff0 );
488
+ pci_read_config_dword (bridge , PCI_PREF_MEMORY_BASE , & pmem );
489
+ pci_write_config_dword (bridge , PCI_PREF_MEMORY_BASE , 0x0 );
490
+ }
491
+ if (!pmem )
492
+ return ;
493
+
494
+ bridge -> pref_window = 1 ;
495
+
496
+ if ((pmem & PCI_PREF_RANGE_TYPE_MASK ) == PCI_PREF_RANGE_TYPE_64 ) {
497
+
498
+ /*
499
+ * Bridge claims to have a 64-bit prefetchable memory
500
+ * window; verify that the upper bits are actually
501
+ * writable.
502
+ */
503
+ pci_read_config_dword (bridge , PCI_PREF_BASE_UPPER32 , & pmem );
504
+ pci_write_config_dword (bridge , PCI_PREF_BASE_UPPER32 ,
505
+ 0xffffffff );
506
+ pci_read_config_dword (bridge , PCI_PREF_BASE_UPPER32 , & tmp );
507
+ pci_write_config_dword (bridge , PCI_PREF_BASE_UPPER32 , pmem );
508
+ if (tmp )
509
+ bridge -> pref_64_window = 1 ;
510
+ }
511
+ }
512
+
513
513
void pci_read_bridge_bases (struct pci_bus * child )
514
514
{
515
515
struct pci_dev * dev = child -> self ;
0 commit comments