Lines Matching full:bios
36 * BIOS.
46 /* Check if current bios is an ATOM BIOS.
47 * Return true if it is ATOM BIOS. Otherwise, return false.
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()
65 DRM_INFO("Can't locate bios header\n"); in check_atom_bios()
71 DRM_INFO("BIOS header is broken\n"); 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()
86 * part of the system bios. On boot, the system bios puts a
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()
181 DRM_ERROR("no memory to allocate for BIOS\n"); in amdgpu_read_bios_from_rom()
186 /* read complete 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()
231 /* ATRM is used to get the BIOS on the discrete cards in
240 * @bios: vbios image pointer
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()
323 dev_err(adev->dev, "Unable to allocate bios\n"); 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()
460 dev_err(adev->dev, "Unable to locate a BIOS ROM\n"); in amdgpu_get_bios()
468 /* helper function for soc15 and onwards to read bios from rom */
470 u8 *bios, u32 length_bytes) in amdgpu_soc15_read_bios_from_rom() argument
478 if (bios == NULL) in amdgpu_soc15_read_bios_from_rom()
490 dw_ptr = (u32 *)bios; in amdgpu_soc15_read_bios_from_rom()