Lines Matching full:rom

3  * PCI ROM access routines
16 * pci_enable_rom - enable ROM decoding for a PCI device
19 * Enable ROM decoding on @dev. This involves simply turning on the last
20 * bit of the PCI ROM BAR. Note that some cards may share address decoders
21 * between the ROM and other resources, so enabling it may disable access
38 * Ideally pci_update_resource() would update the ROM BAR address, in pci_enable_rom()
40 * devices have buggy ROM BARs that read as zero when disabled. in pci_enable_rom()
52 * pci_disable_rom - disable ROM decoding for a PCI device
55 * Disable ROM decoding on a PCI device by turning off the last bit in the
56 * ROM BAR.
73 * pci_get_rom_size - obtain the actual size of the ROM image
75 * @rom: kernel virtual pointer to image of ROM
77 * return: size of actual ROM image
79 * Determine the actual length of the ROM image.
83 static size_t pci_get_rom_size(struct pci_dev *pdev, void __iomem *rom, in pci_get_rom_size() argument
90 image = rom; in pci_get_rom_size()
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()
110 if (image >= rom + size) in pci_get_rom_size()
114 pci_info(pdev, "No more image in the PCI ROM\n"); in pci_get_rom_size()
122 return min((size_t)(image - rom), size); in pci_get_rom_size()
126 * pci_map_rom - map a PCI ROM to kernel space
128 * @size: pointer to receive size of pci window over ROM
130 * Return: kernel virtual pointer to image of ROM
132 * Map a PCI ROM into kernel space. If ROM is boot video ROM,
134 * actual ROM.
140 void __iomem *rom; in pci_map_rom() local
142 /* assign the ROM an address if it doesn't have one */ in pci_map_rom()
151 /* Enable ROM space decodes */ in pci_map_rom()
155 rom = ioremap(start, *size); in pci_map_rom()
156 if (!rom) in pci_map_rom()
160 * Try to find the true size of the ROM since sometimes the PCI window in pci_map_rom()
161 * size is much larger than the actual size of the ROM. in pci_map_rom()
162 * True size is important if the ROM is going to be copied. in pci_map_rom()
164 *size = pci_get_rom_size(pdev, rom, *size); in pci_map_rom()
168 return rom; in pci_map_rom()
171 iounmap(rom); in pci_map_rom()
181 * pci_unmap_rom - unmap the ROM from kernel space
183 * @rom: virtual address of the previous mapping
185 * Remove a mapping of a previously mapped ROM
187 void pci_unmap_rom(struct pci_dev *pdev, void __iomem *rom) in pci_unmap_rom() argument
191 iounmap(rom); in pci_unmap_rom()
200 * pci_platform_rom - provides a pointer to any ROM image provided by the
203 * @size: pointer to receive size of pci window over ROM
207 if (pdev->rom && pdev->romlen) { in pci_platform_rom()
209 return phys_to_virt((phys_addr_t)pdev->rom); in pci_platform_rom()