switch from bar0 in tables to using probed bar0 pcie values #1

This commit is contained in:
Ole Algoritme
2023-05-02 21:34:02 +02:00
parent e37d296b9a
commit 80a44fff4d

18
gddr6.c
View File

@@ -37,13 +37,12 @@ struct device
// device table // device table
static const struct device dev_table[] = struct device dev_table[] =
{ {
{ .bar0 = 0xEC000000, .offset = 0x0000E2A8, .dev_id = 0x2684, .vram = "GDDR6X", .arch = "AD102", .name = "RTX 4090" }, { .offset = 0x0000E2A8, .dev_id = 0x2684, .vram = "GDDR6X", .arch = "AD102", .name = "RTX 4090" },
{ .bar0 = 0xFB000000, .offset = 0x0000E2A8, .dev_id = 0x2204, .vram = "GDDR6X", .arch = "GA102", .name = "RTX 3090" }, { .offset = 0x0000E2A8, .dev_id = 0x2204, .vram = "GDDR6X", .arch = "GA102", .name = "RTX 3090" },
{ .bar0 = 0xFA000000, .offset = 0x0000E2A8, .dev_id = 0x2204, .vram = "GDDR6X", .arch = "GA102", .name = "RTX 3090" }, { .offset = 0x0000EE50, .dev_id = 0x2484, .vram = "GDDR6", .arch = "GA104", .name = "RTX 3070" },
{ .bar0 = 0xFB000000, .offset = 0x0000EE50, .dev_id = 0x2484, .vram = "GDDR6", .arch = "GA104", .name = "RTX 3070" }, { .offset = 0x0000EE50, .dev_id = 0x2488, .vram = "GDDR6", .arch = "GA104", .name = "RTX 3070-LHR" },
{ .bar0 = 0xFB000000, .offset = 0x0000EE50, .dev_id = 0x2488, .vram = "GDDR6", .arch = "GA104", .name = "RTX 3070-LHR" },
}; };
@@ -107,12 +106,7 @@ struct device *pci_detect_dev(void)
if (pci_dev->device_id == dev_table[i].dev_id) if (pci_dev->device_id == dev_table[i].dev_id)
{ {
device = (struct device *) &dev_table[i]; device = (struct device *) &dev_table[i];
device->bar0 = (pci_dev->base_addr[0] & 0xFFFFFFFF);
if (pci_dev->base_addr[0] != device->bar0)
{
device->bar0 = pci_dev->base_addr[0];
}
break; break;
} }
} }