Lines Matching refs:bios

49 static bool check_atom_bios(uint8_t *bios, size_t size)  in check_atom_bios()  argument
53 if (!bios || size < 0x49) { in check_atom_bios()
58 if (!AMD_IS_VALID_VBIOS(bios)) { in check_atom_bios()
59 DRM_INFO("BIOS signature incorrect %x %x\n", bios[0], bios[1]); in check_atom_bios()
63 bios_header_start = bios[0x48] | (bios[0x49] << 8); in check_atom_bios()
75 if (!memcmp(bios + tmp, "ATOM", 4) || in check_atom_bios()
76 !memcmp(bios + tmp, "MOTA", 4)) { in check_atom_bios()
92 uint8_t __iomem *bios; in igp_read_bios_from_vram() local
104 adev->bios = NULL; in igp_read_bios_from_vram()
106 bios = ioremap_wc(vram_base, size); in igp_read_bios_from_vram()
107 if (!bios) { 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()
113 iounmap(bios); in igp_read_bios_from_vram()
117 memcpy_fromio(adev->bios, bios, size); in igp_read_bios_from_vram()
118 iounmap(bios); 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()
130 uint8_t __iomem *bios; in amdgpu_read_bios() local
133 adev->bios = NULL; in amdgpu_read_bios()
135 bios = pci_map_rom(adev->pdev, &size); in amdgpu_read_bios()
136 if (!bios) { in amdgpu_read_bios()
140 adev->bios = kzalloc(size, GFP_KERNEL); in amdgpu_read_bios()
141 if (adev->bios == NULL) { in amdgpu_read_bios()
142 pci_unmap_rom(adev->pdev, bios); in amdgpu_read_bios()
146 memcpy_fromio(adev->bios, bios, size); in amdgpu_read_bios()
147 pci_unmap_rom(adev->pdev, bios); in amdgpu_read_bios()
149 if (!check_atom_bios(adev->bios, size)) { in amdgpu_read_bios()
150 kfree(adev->bios); in amdgpu_read_bios()
179 adev->bios = kmalloc(len, GFP_KERNEL); in amdgpu_read_bios_from_rom()
180 if (!adev->bios) { in amdgpu_read_bios_from_rom()
187 amdgpu_asic_read_bios_from_rom(adev, adev->bios, len); in amdgpu_read_bios_from_rom()
189 if (!check_atom_bios(adev->bios, len)) { in amdgpu_read_bios_from_rom()
190 kfree(adev->bios); in amdgpu_read_bios_from_rom()
201 void __iomem *bios; in amdgpu_read_platform_bios() local
203 adev->bios = NULL; in amdgpu_read_platform_bios()
208 adev->bios = kzalloc(romlen, GFP_KERNEL); in amdgpu_read_platform_bios()
209 if (!adev->bios) in amdgpu_read_platform_bios()
212 bios = ioremap(rom, romlen); in amdgpu_read_platform_bios()
213 if (!bios) in amdgpu_read_platform_bios()
216 memcpy_fromio(adev->bios, bios, romlen); in amdgpu_read_platform_bios()
217 iounmap(bios); in amdgpu_read_platform_bios()
219 if (!check_atom_bios(adev->bios, romlen)) in amdgpu_read_platform_bios()
226 kfree(adev->bios); in amdgpu_read_platform_bios()
248 static int amdgpu_atrm_call(acpi_handle atrm_handle, uint8_t *bios, in amdgpu_atrm_call() argument
272 memcpy(bios+offset, obj->buffer.pointer, obj->buffer.length); in amdgpu_atrm_call()
321 adev->bios = kmalloc(size, GFP_KERNEL); in amdgpu_atrm_get_bios()
322 if (!adev->bios) { in amdgpu_atrm_get_bios()
329 adev->bios, in amdgpu_atrm_get_bios()
336 if (!check_atom_bios(adev->bios, size)) { in amdgpu_atrm_get_bios()
337 kfree(adev->bios); in amdgpu_atrm_get_bios()
400 adev->bios = kmemdup(&vbios->VbiosContent, in amdgpu_acpi_vfct_bios()
404 if (!check_atom_bios(adev->bios, vhdr->ImageLength)) { in amdgpu_acpi_vfct_bios()
405 kfree(adev->bios); in amdgpu_acpi_vfct_bios()