Rev 2351 | Rev 4280 | Go to most recent revision | Show entire file | Regard whitespace | Details | Blame | Last modification | View Log | RSS feed
Rev 2351 | Rev 3031 | ||
---|---|---|---|
Line 675... | Line 675... | ||
675 | region->start = res->start; |
675 | region->start = res->start; |
676 | region->end = res->end; |
676 | region->end = res->end; |
677 | } |
677 | } |
678 | 678 | ||
Line 679... | Line -... | ||
679 | static inline int pci_read_config_dword(struct pci_dev *dev, int where, |
- | |
680 | u32 *val) |
- | |
681 | { |
- | |
682 | *val = PciRead32(dev->busnr, dev->devfn, where); |
- | |
683 | return 1; |
- | |
684 | } |
- | |
685 | - | ||
686 | static inline int pci_write_config_dword(struct pci_dev *dev, int where, |
- | |
687 | u32 val) |
- | |
688 | { |
- | |
689 | PciWrite32(dev->busnr, dev->devfn, where, val); |
- | |
690 | return 1; |
- | |
691 | } |
- | |
Line 692... | Line 679... | ||
692 | 679 | ||
693 | int pci_enable_rom(struct pci_dev *pdev) |
680 | int pci_enable_rom(struct pci_dev *pdev) |
694 | { |
681 | { |
695 | struct resource *res = pdev->resource + PCI_ROM_RESOURCE; |
682 | struct resource *res = pdev->resource + PCI_ROM_RESOURCE; |
Line 842... | Line 829... | ||
842 | if (!(res->flags & (IORESOURCE_ROM_ENABLE | IORESOURCE_ROM_SHADOW))) |
829 | if (!(res->flags & (IORESOURCE_ROM_ENABLE | IORESOURCE_ROM_SHADOW))) |
843 | pci_disable_rom(pdev); |
830 | pci_disable_rom(pdev); |
844 | }>=>>>><>><>><>>4)><4)> |
831 | } |
845 | 832 | ||
Line -... | Line 833... | ||
- | 833 | #if 0 |
|
- | 834 | void pcibios_set_master(struct pci_dev *dev) |
|
- | 835 | { |
|
- | 836 | u8 lat; |
|
- | 837 | ||
- | 838 | /* The latency timer doesn't apply to PCIe (either Type 0 or Type 1) */ |
|
- | 839 | if (pci_is_pcie(dev)) |
|
- | 840 | return; |
|
- | 841 | ||
- | 842 | pci_read_config_byte(dev, PCI_LATENCY_TIMER, &lat); |
|
- | 843 | if (lat < 16) |
|
- | 844 | lat = (64 <= pcibios_max_latency) ? 64 : pcibios_max_latency; |
|
- | 845 | else if (lat > pcibios_max_latency) |
|
- | 846 | lat = pcibios_max_latency; |
|
- | 847 | else |
|
- | 848 | return; |
|
- | 849 | dev_printk(KERN_DEBUG, &dev->dev, "setting latency timer to %d\n", lat); |
|
- | 850 | pci_write_config_byte(dev, PCI_LATENCY_TIMER, lat); |
|
- | 851 | } |
|
- | 852 | #endif |
|
- | 853 | ||
- | 854 | ||
- | 855 | static void __pci_set_master(struct pci_dev *dev, bool enable) |
|
- | 856 | { |
|
- | 857 | u16 old_cmd, cmd; |
|
- | 858 | ||
- | 859 | pci_read_config_word(dev, PCI_COMMAND, &old_cmd); |
|
- | 860 | if (enable) |
|
- | 861 | cmd = old_cmd | PCI_COMMAND_MASTER; |
|
- | 862 | else |
|
- | 863 | cmd = old_cmd & ~PCI_COMMAND_MASTER; |
|
- | 864 | if (cmd != old_cmd) { |
|
- | 865 | dbgprintf("%s bus mastering\n", |
|
- | 866 | enable ? "enabling" : "disabling"); |
|
- | 867 | pci_write_config_word(dev, PCI_COMMAND, cmd); |
|
- | 868 | } |
|
- | 869 | dev->is_busmaster = enable; |
|
- | 870 | } |
|
- | 871 | ||
- | 872 | void pci_set_master(struct pci_dev *dev) |
|
- | 873 | { |
|
- | 874 | __pci_set_master(dev, true); |
|
- | 875 | // pcibios_set_master(dev); |
|
- | 876 | }=>>>=>>>><>><>><>>4)><4)> |
|
- | 877 | ||
- | 878 | ||
- | 879 |