Attachment '01-amdgpu_20.40_on_linux_4.19-v3.patch'
Download 1 From 72e0ef0e5f067fd991f702f0b2635d911d0cf208 Mon Sep 17 00:00:00 2001
2 From: Mikel Rychliski <mikel@mikelr.com>
3 Date: Wed, 18 Mar 2020 22:16:23 -0400
4 Subject: PCI: Use ioremap(), not phys_to_virt() for platform ROM
5 https://cgit.freedesktop.org/~agd5f/linux/patch/?id=72e0ef0e5f067fd991f702f0b2635d911d0cf208
6 Usage: "cd /usr/src/amdgpu-5.6.20.906300-1164792 && patch -p1 < this.patch"
7
8 --- old/amd/amdgpu/amdgpu_bios.c 2020-10-22 09:53:01.000000000 +0200
9 +++ new/amd/amdgpu/amdgpu_bios.c 2020-12-06 15:18:55.702641677 +0100
10 @@ -192,6 +192,37 @@
11
12 static bool amdgpu_read_platform_bios(struct amdgpu_device *adev)
13 {
14 +#if ( LINUX_VERSION_CODE >= KERNEL_VERSION(4, 19, 149) && LINUX_VERSION_CODE < KERNEL_VERSION(4, 20, 0) ) || ( LINUX_VERSION_CODE >= KERNEL_VERSION(5, 4, 69) && LINUX_VERSION_CODE < KERNEL_VERSION(5, 5, 0) ) || ( LINUX_VERSION_CODE >= KERNEL_VERSION(5, 7, 0) )
15 + phys_addr_t rom = adev->pdev->rom;
16 + size_t romlen = adev->pdev->romlen;
17 + void __iomem *bios;
18 +
19 + adev->bios = NULL;
20 +
21 + if (!rom || romlen == 0)
22 + return false;
23 +
24 + adev->bios = kzalloc(romlen, GFP_KERNEL);
25 + if (!adev->bios)
26 + return false;
27 +
28 + bios = ioremap(rom, romlen);
29 + if (!bios)
30 + goto free_bios;
31 +
32 + memcpy_fromio(adev->bios, bios, romlen);
33 + iounmap(bios);
34 +
35 + if (!check_atom_bios(adev->bios, romlen))
36 + goto free_bios;
37 +
38 + adev->bios_size = romlen;
39 +
40 + return true;
41 +free_bios:
42 + kfree(adev->bios);
43 + return false;
44 +#else
45 uint8_t __iomem *bios;
46 size_t size;
47
48 @@ -216,6 +247,7 @@
49 adev->bios_size = size;
50
51 return true;
52 +#endif
53 }
54
55 #ifdef CONFIG_ACPI
Attached Files
To refer to attachments on a page, use attachment:filename, as shown below in the list of files. Do NOT use the URL of the [get] link, since this is subject to change and can break easily.You are not allowed to attach a file to this page.
