Lines Matching +full:rom +full:-

86  * the IGP rom is not accessible via the rom bar as the IGP rom is
88 * copy of the igp rom at the start of vram if a discrete card is
97 if (!(adev->flags & AMD_IS_APU)) in igp_read_bios_from_vram()
102 if (pci_resource_len(adev->pdev, 0) == 0) in igp_read_bios_from_vram()
105 adev->bios = NULL; in igp_read_bios_from_vram()
106 vram_base = pci_resource_start(adev->pdev, 0); in igp_read_bios_from_vram()
111 adev->bios = kmalloc(size, GFP_KERNEL); in igp_read_bios_from_vram()
112 if (!adev->bios) { in igp_read_bios_from_vram()
116 adev->bios_size = size; in igp_read_bios_from_vram()
117 memcpy_fromio(adev->bios, bios, size); in igp_read_bios_from_vram()
120 if (!check_atom_bios(adev->bios, size)) { in igp_read_bios_from_vram()
121 kfree(adev->bios); in igp_read_bios_from_vram()
133 adev->bios = NULL; in amdgpu_read_bios()
134 /* XXX: some cards may return 0 for rom size? ddx has a workaround */ in amdgpu_read_bios()
135 bios = pci_map_rom(adev->pdev, &size); in amdgpu_read_bios()
139 adev->bios = kzalloc(size, GFP_KERNEL); in amdgpu_read_bios()
140 if (adev->bios == NULL) { in amdgpu_read_bios()
141 pci_unmap_rom(adev->pdev, bios); in amdgpu_read_bios()
144 adev->bios_size = size; in amdgpu_read_bios()
145 memcpy_fromio(adev->bios, bios, size); in amdgpu_read_bios()
146 pci_unmap_rom(adev->pdev, bios); in amdgpu_read_bios()
148 if (!check_atom_bios(adev->bios, size)) { in amdgpu_read_bios()
149 kfree(adev->bios); in amdgpu_read_bios()
161 if (!adev->asic_funcs || !adev->asic_funcs->read_bios_from_rom) in amdgpu_read_bios_from_rom()
178 adev->bios = kmalloc(len, GFP_KERNEL); in amdgpu_read_bios_from_rom()
179 if (!adev->bios) { in amdgpu_read_bios_from_rom()
183 adev->bios_size = len; in amdgpu_read_bios_from_rom()
186 amdgpu_asic_read_bios_from_rom(adev, adev->bios, len); in amdgpu_read_bios_from_rom()
188 if (!check_atom_bios(adev->bios, len)) { in amdgpu_read_bios_from_rom()
189 kfree(adev->bios); in amdgpu_read_bios_from_rom()
198 phys_addr_t rom = adev->pdev->rom; in amdgpu_read_platform_bios() local
199 size_t romlen = adev->pdev->romlen; in amdgpu_read_platform_bios()
202 adev->bios = NULL; in amdgpu_read_platform_bios()
204 if (!rom || romlen == 0) in amdgpu_read_platform_bios()
207 adev->bios = kzalloc(romlen, GFP_KERNEL); in amdgpu_read_platform_bios()
208 if (!adev->bios) in amdgpu_read_platform_bios()
211 bios = ioremap(rom, romlen); in amdgpu_read_platform_bios()
215 memcpy_fromio(adev->bios, bios, romlen); in amdgpu_read_platform_bios()
218 if (!check_atom_bios(adev->bios, romlen)) in amdgpu_read_platform_bios()
221 adev->bios_size = romlen; in amdgpu_read_platform_bios()
225 kfree(adev->bios); in amdgpu_read_platform_bios()
231 * dual-gpu systems.
233 /* retrieve the ROM in 4k blocks */
236 * amdgpu_atrm_call - fetch a chunk of the vbios
267 return -ENODEV; in amdgpu_atrm_call()
271 memcpy(bios+offset, obj->buffer.pointer, obj->buffer.length); in amdgpu_atrm_call()
272 len = obj->buffer.length; in amdgpu_atrm_call()
288 if (adev->flags & AMD_IS_APU) in amdgpu_atrm_get_bios()
291 /* ATRM is for on-platform devices only */ in amdgpu_atrm_get_bios()
292 if (dev_is_removable(&adev->pdev->dev)) in amdgpu_atrm_get_bios()
296 dhandle = ACPI_HANDLE(&pdev->dev); in amdgpu_atrm_get_bios()
309 dhandle = ACPI_HANDLE(&pdev->dev); in amdgpu_atrm_get_bios()
325 adev->bios = kmalloc(size, GFP_KERNEL); in amdgpu_atrm_get_bios()
326 if (!adev->bios) { in amdgpu_atrm_get_bios()
327 dev_err(adev->dev, "Unable to allocate bios\n"); in amdgpu_atrm_get_bios()
333 adev->bios, in amdgpu_atrm_get_bios()
340 if (!check_atom_bios(adev->bios, size)) { in amdgpu_atrm_get_bios()
341 kfree(adev->bios); in amdgpu_atrm_get_bios()
344 adev->bios_size = size; in amdgpu_atrm_get_bios()
356 if (adev->flags & AMD_IS_APU) in amdgpu_read_disabled_bios()
359 return (!adev->asic_funcs || !adev->asic_funcs->read_disabled_bios) ? in amdgpu_read_disabled_bios()
373 tbl_size = hdr->length; in amdgpu_acpi_vfct_bios()
375 dev_info(adev->dev, "ACPI VFCT table present but broken (too short #1),skipping\n"); in amdgpu_acpi_vfct_bios()
380 offset = vfct->VBIOSImageOffset; in amdgpu_acpi_vfct_bios()
384 VFCT_IMAGE_HEADER *vhdr = &vbios->VbiosHeader; in amdgpu_acpi_vfct_bios()
388 dev_info(adev->dev, "ACPI VFCT image header truncated,skipping\n"); in amdgpu_acpi_vfct_bios()
392 offset += vhdr->ImageLength; in amdgpu_acpi_vfct_bios()
394 dev_info(adev->dev, "ACPI VFCT image truncated,skipping\n"); in amdgpu_acpi_vfct_bios()
398 if (vhdr->ImageLength && in amdgpu_acpi_vfct_bios()
399 vhdr->PCIBus == adev->pdev->bus->number && in amdgpu_acpi_vfct_bios()
400 vhdr->PCIDevice == PCI_SLOT(adev->pdev->devfn) && in amdgpu_acpi_vfct_bios()
401 vhdr->PCIFunction == PCI_FUNC(adev->pdev->devfn) && in amdgpu_acpi_vfct_bios()
402 vhdr->VendorID == adev->pdev->vendor && in amdgpu_acpi_vfct_bios()
403 vhdr->DeviceID == adev->pdev->device) { in amdgpu_acpi_vfct_bios()
404 adev->bios = kmemdup(&vbios->VbiosContent, in amdgpu_acpi_vfct_bios()
405 vhdr->ImageLength, in amdgpu_acpi_vfct_bios()
408 if (!check_atom_bios(adev->bios, vhdr->ImageLength)) { in amdgpu_acpi_vfct_bios()
409 kfree(adev->bios); in amdgpu_acpi_vfct_bios()
412 adev->bios_size = vhdr->ImageLength; in amdgpu_acpi_vfct_bios()
417 dev_info(adev->dev, "ACPI VFCT table present but broken (too short #2),skipping\n"); in amdgpu_acpi_vfct_bios()
430 dev_info(adev->dev, "Fetched VBIOS from ATRM\n"); in amdgpu_get_bios()
435 dev_info(adev->dev, "Fetched VBIOS from VFCT\n"); in amdgpu_get_bios()
440 dev_info(adev->dev, "Fetched VBIOS from VRAM BAR\n"); in amdgpu_get_bios()
445 dev_info(adev->dev, "Fetched VBIOS from ROM BAR\n"); in amdgpu_get_bios()
450 dev_info(adev->dev, "Fetched VBIOS from ROM\n"); in amdgpu_get_bios()
455 dev_info(adev->dev, "Fetched VBIOS from disabled ROM BAR\n"); in amdgpu_get_bios()
460 dev_info(adev->dev, "Fetched VBIOS from platform\n"); in amdgpu_get_bios()
464 dev_err(adev->dev, "Unable to locate a BIOS ROM\n"); in amdgpu_get_bios()
468 adev->is_atom_fw = adev->asic_type >= CHIP_VEGA10; in amdgpu_get_bios()
472 /* helper function for soc15 and onwards to read bios from rom */
487 if (adev->flags & AMD_IS_APU) in amdgpu_soc15_read_bios_from_rom()
489 if (!adev->smuio.funcs || in amdgpu_soc15_read_bios_from_rom()
490 !adev->smuio.funcs->get_rom_index_offset || in amdgpu_soc15_read_bios_from_rom()
491 !adev->smuio.funcs->get_rom_data_offset) in amdgpu_soc15_read_bios_from_rom()
498 adev->smuio.funcs->get_rom_index_offset(adev); in amdgpu_soc15_read_bios_from_rom()
500 adev->smuio.funcs->get_rom_data_offset(adev); in amdgpu_soc15_read_bios_from_rom()
502 if (adev->nbio.funcs && in amdgpu_soc15_read_bios_from_rom()
503 adev->nbio.funcs->get_rom_offset) { in amdgpu_soc15_read_bios_from_rom()
504 rom_offset = adev->nbio.funcs->get_rom_offset(adev); in amdgpu_soc15_read_bios_from_rom()
510 /* set rom index to rom_offset */ in amdgpu_soc15_read_bios_from_rom()
512 /* read out the rom data */ in amdgpu_soc15_read_bios_from_rom()