Lines Matching +full:rom +full:-
44 * the IGP rom is not accessible via the rom bar as the IGP rom is
46 * copy of the igp rom at the start of vram if a discrete card is
55 if (!(rdev->flags & RADEON_IS_IGP)) in igp_read_bios_from_vram()
59 rdev->bios = NULL; in igp_read_bios_from_vram()
60 vram_base = pci_resource_start(rdev->pdev, 0); in igp_read_bios_from_vram()
70 rdev->bios = kmalloc(size, GFP_KERNEL); in igp_read_bios_from_vram()
71 if (rdev->bios == NULL) { in igp_read_bios_from_vram()
75 memcpy_fromio(rdev->bios, bios, size); in igp_read_bios_from_vram()
85 rdev->bios = NULL; in radeon_read_bios()
86 /* XXX: some cards may return 0 for rom size? ddx has a workaround */ in radeon_read_bios()
87 bios = pci_map_rom(rdev->pdev, &size); in radeon_read_bios()
96 pci_unmap_rom(rdev->pdev, bios); in radeon_read_bios()
99 rdev->bios = kzalloc(size, GFP_KERNEL); in radeon_read_bios()
100 if (rdev->bios == NULL) { in radeon_read_bios()
101 pci_unmap_rom(rdev->pdev, bios); in radeon_read_bios()
104 memcpy_fromio(rdev->bios, bios, size); in radeon_read_bios()
105 pci_unmap_rom(rdev->pdev, bios); in radeon_read_bios()
111 phys_addr_t rom = rdev->pdev->rom; in radeon_read_platform_bios() local
112 size_t romlen = rdev->pdev->romlen; in radeon_read_platform_bios()
115 rdev->bios = NULL; in radeon_read_platform_bios()
117 if (!rom || romlen == 0) in radeon_read_platform_bios()
120 rdev->bios = kzalloc(romlen, GFP_KERNEL); in radeon_read_platform_bios()
121 if (!rdev->bios) in radeon_read_platform_bios()
124 bios = ioremap(rom, romlen); in radeon_read_platform_bios()
128 memcpy_fromio(rdev->bios, bios, romlen); in radeon_read_platform_bios()
131 if (rdev->bios[0] != 0x55 || rdev->bios[1] != 0xaa) in radeon_read_platform_bios()
136 kfree(rdev->bios); in radeon_read_platform_bios()
142 * dual-gpu systems.
144 /* retrieve the ROM in 4k blocks */
147 * radeon_atrm_call - fetch a chunk of the vbios
178 return -ENODEV; in radeon_atrm_call()
182 memcpy(bios+offset, obj->buffer.pointer, obj->buffer.length); in radeon_atrm_call()
183 len = obj->buffer.length; in radeon_atrm_call()
199 if (rdev->flags & RADEON_IS_IGP) in radeon_atrm_get_bios()
203 if ((pdev->class != PCI_CLASS_DISPLAY_VGA << 8) && in radeon_atrm_get_bios()
204 (pdev->class != PCI_CLASS_DISPLAY_OTHER << 8)) in radeon_atrm_get_bios()
207 dhandle = ACPI_HANDLE(&pdev->dev); in radeon_atrm_get_bios()
222 rdev->bios = kmalloc(size, GFP_KERNEL); in radeon_atrm_get_bios()
223 if (!rdev->bios) { in radeon_atrm_get_bios()
230 rdev->bios, in radeon_atrm_get_bios()
237 if (i == 0 || rdev->bios[0] != 0x55 || rdev->bios[1] != 0xaa) { in radeon_atrm_get_bios()
238 kfree(rdev->bios); in radeon_atrm_get_bios()
265 /* enable the rom */ in ni_read_disabled_bios()
314 /* enable the rom */ in r700_read_disabled_bios()
326 if (rdev->family == CHIP_RV730) { in r700_read_disabled_bios()
345 if (rdev->family == CHIP_RV730) { in r700_read_disabled_bios()
393 /* enable the rom */ in r600_read_disabled_bios()
472 /* enable the rom */ in avivo_read_disabled_bios()
513 if (rdev->flags & RADEON_IS_PCIE) in legacy_read_disabled_bios()
522 if (rdev->pdev->device == PCI_DEVICE_ID_ATI_RADEON_QY) { in legacy_read_disabled_bios()
526 if (!(rdev->flags & RADEON_SINGLE_CRTC)) { in legacy_read_disabled_bios()
537 /* enable the rom */ in legacy_read_disabled_bios()
538 if (rdev->flags & RADEON_IS_PCIE) in legacy_read_disabled_bios()
548 if (!(rdev->flags & RADEON_SINGLE_CRTC)) { in legacy_read_disabled_bios()
559 if (rdev->pdev->device == PCI_DEVICE_ID_ATI_RADEON_QY) { in legacy_read_disabled_bios()
568 if (rdev->flags & RADEON_IS_PCIE) in legacy_read_disabled_bios()
573 if (!(rdev->flags & RADEON_SINGLE_CRTC)) { in legacy_read_disabled_bios()
577 if (rdev->pdev->device == PCI_DEVICE_ID_ATI_RADEON_QY) { in legacy_read_disabled_bios()
585 if (rdev->flags & RADEON_IS_IGP) in radeon_read_disabled_bios()
587 else if (rdev->family >= CHIP_BARTS) in radeon_read_disabled_bios()
589 else if (rdev->family >= CHIP_RV770) in radeon_read_disabled_bios()
591 else if (rdev->family >= CHIP_R600) in radeon_read_disabled_bios()
593 else if (rdev->family >= CHIP_RS600) in radeon_read_disabled_bios()
610 tbl_size = hdr->length; in radeon_acpi_vfct_bios()
617 offset = vfct->VBIOSImageOffset; in radeon_acpi_vfct_bios()
621 VFCT_IMAGE_HEADER *vhdr = &vbios->VbiosHeader; in radeon_acpi_vfct_bios()
629 offset += vhdr->ImageLength; in radeon_acpi_vfct_bios()
635 if (vhdr->ImageLength && in radeon_acpi_vfct_bios()
636 vhdr->PCIBus == rdev->pdev->bus->number && in radeon_acpi_vfct_bios()
637 vhdr->PCIDevice == PCI_SLOT(rdev->pdev->devfn) && in radeon_acpi_vfct_bios()
638 vhdr->PCIFunction == PCI_FUNC(rdev->pdev->devfn) && in radeon_acpi_vfct_bios()
639 vhdr->VendorID == rdev->pdev->vendor && in radeon_acpi_vfct_bios()
640 vhdr->DeviceID == rdev->pdev->device) { in radeon_acpi_vfct_bios()
641 rdev->bios = kmemdup(&vbios->VbiosContent, in radeon_acpi_vfct_bios()
642 vhdr->ImageLength, in radeon_acpi_vfct_bios()
644 if (rdev->bios) in radeon_acpi_vfct_bios()
680 if (!r || rdev->bios == NULL) { in radeon_get_bios()
681 DRM_ERROR("Unable to locate a BIOS ROM\n"); in radeon_get_bios()
682 rdev->bios = NULL; in radeon_get_bios()
685 if (rdev->bios[0] != 0x55 || rdev->bios[1] != 0xaa) { in radeon_get_bios()
686 printk("BIOS signature incorrect %x %x\n", rdev->bios[0], rdev->bios[1]); in radeon_get_bios()
692 DRM_INFO("Not an x86 BIOS ROM, not using.\n"); in radeon_get_bios()
696 rdev->bios_header_start = RBIOS16(0x48); in radeon_get_bios()
697 if (!rdev->bios_header_start) { in radeon_get_bios()
700 tmp = rdev->bios_header_start + 4; in radeon_get_bios()
701 if (!memcmp(rdev->bios + tmp, "ATOM", 4) || in radeon_get_bios()
702 !memcmp(rdev->bios + tmp, "MOTA", 4)) { in radeon_get_bios()
703 rdev->is_atom_bios = true; in radeon_get_bios()
705 rdev->is_atom_bios = false; in radeon_get_bios()
708 DRM_DEBUG("%sBIOS detected\n", rdev->is_atom_bios ? "ATOM" : "COM"); in radeon_get_bios()
711 kfree(rdev->bios); in radeon_get_bios()
712 rdev->bios = NULL; in radeon_get_bios()