Lines Matching full:bios
37 * BIOS.
47 /* Check if current bios is an ATOM BIOS.
48 * Return true if it is ATOM BIOS. Otherwise, return false.
50 static bool check_atom_bios(uint8_t *bios, size_t size) in check_atom_bios() argument
54 if (!bios || size < 0x49) { in check_atom_bios()
59 if (!AMD_IS_VALID_VBIOS(bios)) { in check_atom_bios()
60 DRM_INFO("BIOS signature incorrect %x %x\n", bios[0], bios[1]); in check_atom_bios()
64 bios_header_start = bios[0x48] | (bios[0x49] << 8); in check_atom_bios()
66 DRM_INFO("Can't locate bios header\n"); in check_atom_bios()
72 DRM_INFO("BIOS header is broken\n"); in check_atom_bios()
76 if (!memcmp(bios + tmp, "ATOM", 4) || in check_atom_bios()
77 !memcmp(bios + tmp, "MOTA", 4)) { in check_atom_bios()
87 * part of the system bios. On boot, the system bios puts a
93 uint8_t __iomem *bios; in igp_read_bios_from_vram() local
105 adev->bios = NULL; in igp_read_bios_from_vram()
107 bios = ioremap_wc(vram_base, size); in igp_read_bios_from_vram()
108 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()
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()
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()
178 adev->bios = kmalloc(len, GFP_KERNEL); in amdgpu_read_bios_from_rom()
179 if (!adev->bios) { in amdgpu_read_bios_from_rom()
180 DRM_ERROR("no memory to allocate for BIOS\n"); in amdgpu_read_bios_from_rom()
185 /* read complete BIOS */ 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()
200 void __iomem *bios; in amdgpu_read_platform_bios() local
202 adev->bios = NULL; 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()
212 if (!bios) in amdgpu_read_platform_bios()
215 memcpy_fromio(adev->bios, bios, romlen); in amdgpu_read_platform_bios()
216 iounmap(bios); in amdgpu_read_platform_bios()
218 if (!check_atom_bios(adev->bios, romlen)) in amdgpu_read_platform_bios()
225 kfree(adev->bios); in amdgpu_read_platform_bios()
230 /* ATRM is used to get the BIOS on the discrete cards in
239 * @bios: vbios image pointer
247 static int amdgpu_atrm_call(acpi_handle atrm_handle, uint8_t *bios, in amdgpu_atrm_call() argument
271 memcpy(bios+offset, obj->buffer.pointer, obj->buffer.length); in amdgpu_atrm_call()
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()
404 adev->bios = kmemdup(&vbios->VbiosContent, 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()
464 dev_err(adev->dev, "Unable to locate a BIOS ROM\n"); in amdgpu_get_bios()
472 /* helper function for soc15 and onwards to read bios from rom */
474 u8 *bios, u32 length_bytes) in amdgpu_soc15_read_bios_from_rom() argument
482 if (bios == NULL) in amdgpu_soc15_read_bios_from_rom()
494 dw_ptr = (u32 *)bios; in amdgpu_soc15_read_bios_from_rom()