Lines Matching refs:pdev
24 int pci_enable_rom(struct pci_dev *pdev) in pci_enable_rom() argument
26 struct resource *res = &pdev->resource[PCI_ROM_RESOURCE]; in pci_enable_rom()
42 pcibios_resource_to_bus(pdev->bus, ®ion, res); in pci_enable_rom()
43 pci_read_config_dword(pdev, pdev->rom_base_reg, &rom_addr); in pci_enable_rom()
46 pci_write_config_dword(pdev, pdev->rom_base_reg, rom_addr); in pci_enable_rom()
58 void pci_disable_rom(struct pci_dev *pdev) in pci_disable_rom() argument
60 struct resource *res = &pdev->resource[PCI_ROM_RESOURCE]; in pci_disable_rom()
66 pci_read_config_dword(pdev, pdev->rom_base_reg, &rom_addr); in pci_disable_rom()
68 pci_write_config_dword(pdev, pdev->rom_base_reg, rom_addr); in pci_disable_rom()
83 static size_t pci_get_rom_size(struct pci_dev *pdev, void __iomem *rom, in pci_get_rom_size() argument
95 pci_info(pdev, "Invalid PCI ROM header signature: expecting 0xaa55, got %#06x\n", in pci_get_rom_size()
102 pci_info(pdev, "Invalid PCI ROM data signature: expecting 0x52494350, got %#010x\n", in pci_get_rom_size()
114 pci_info(pdev, "No more image in the PCI ROM\n"); in pci_get_rom_size()
136 void __iomem *pci_map_rom(struct pci_dev *pdev, size_t *size) in pci_map_rom() argument
138 struct resource *res = &pdev->resource[PCI_ROM_RESOURCE]; in pci_map_rom()
143 if (res->parent == NULL && pci_assign_resource(pdev, PCI_ROM_RESOURCE)) in pci_map_rom()
146 start = pci_resource_start(pdev, PCI_ROM_RESOURCE); in pci_map_rom()
147 *size = pci_resource_len(pdev, PCI_ROM_RESOURCE); in pci_map_rom()
152 if (pci_enable_rom(pdev)) in pci_map_rom()
164 *size = pci_get_rom_size(pdev, rom, *size); in pci_map_rom()
175 pci_disable_rom(pdev); in pci_map_rom()
187 void pci_unmap_rom(struct pci_dev *pdev, void __iomem *rom) in pci_unmap_rom() argument
189 struct resource *res = &pdev->resource[PCI_ROM_RESOURCE]; in pci_unmap_rom()
195 pci_disable_rom(pdev); in pci_unmap_rom()
205 void __iomem *pci_platform_rom(struct pci_dev *pdev, size_t *size) in pci_platform_rom() argument
207 if (pdev->rom && pdev->romlen) { in pci_platform_rom()
208 *size = pdev->romlen; in pci_platform_rom()
209 return phys_to_virt((phys_addr_t)pdev->rom); in pci_platform_rom()