|
58 | 58 | /* Capability register E */ |
59 | 59 | #define CAPID_E_OFFSET 0xf0 |
60 | 60 | #define CAPID_E_IBECC BIT(12) |
| 61 | +#define CAPID_E_IBECC_BIT18 BIT(18) |
61 | 62 |
|
62 | 63 | /* Error Status */ |
63 | 64 | #define ERRSTS_OFFSET 0xc8 |
@@ -251,6 +252,11 @@ static struct work_struct ecclog_work; |
251 | 252 | #define DID_MTL_PS_SKU3 0x7d23 |
252 | 253 | #define DID_MTL_PS_SKU4 0x7d24 |
253 | 254 |
|
| 255 | +/* Compute die IDs for Meteor Lake-P with IBECC */ |
| 256 | +#define DID_MTL_P_SKU1 0x7d01 |
| 257 | +#define DID_MTL_P_SKU2 0x7d02 |
| 258 | +#define DID_MTL_P_SKU3 0x7d14 |
| 259 | + |
254 | 260 | static int get_mchbar(struct pci_dev *pdev, u64 *mchbar) |
255 | 261 | { |
256 | 262 | union { |
@@ -331,6 +337,16 @@ static bool tgl_ibecc_available(struct pci_dev *pdev) |
331 | 337 | return !(CAPID_E_IBECC & v); |
332 | 338 | } |
333 | 339 |
|
| 340 | +static bool mtl_p_ibecc_available(struct pci_dev *pdev) |
| 341 | +{ |
| 342 | + u32 v; |
| 343 | + |
| 344 | + if (pci_read_config_dword(pdev, CAPID_E_OFFSET, &v)) |
| 345 | + return false; |
| 346 | + |
| 347 | + return !(CAPID_E_IBECC_BIT18 & v); |
| 348 | +} |
| 349 | + |
334 | 350 | static bool mtl_ps_ibecc_available(struct pci_dev *pdev) |
335 | 351 | { |
336 | 352 | #define MCHBAR_MEMSS_IBECCDIS 0x13c00 |
@@ -524,6 +540,17 @@ static struct res_config mtl_ps_cfg = { |
524 | 540 | .err_addr_to_imc_addr = adl_err_addr_to_imc_addr, |
525 | 541 | }; |
526 | 542 |
|
| 543 | +static struct res_config mtl_p_cfg = { |
| 544 | + .machine_check = true, |
| 545 | + .num_imc = 2, |
| 546 | + .imc_base = 0xd800, |
| 547 | + .ibecc_base = 0xd400, |
| 548 | + .ibecc_error_log_offset = 0x170, |
| 549 | + .ibecc_available = mtl_p_ibecc_available, |
| 550 | + .err_addr_to_sys_addr = adl_err_addr_to_sys_addr, |
| 551 | + .err_addr_to_imc_addr = adl_err_addr_to_imc_addr, |
| 552 | +}; |
| 553 | + |
527 | 554 | static const struct pci_device_id igen6_pci_tbl[] = { |
528 | 555 | { PCI_VDEVICE(INTEL, DID_EHL_SKU5), (kernel_ulong_t)&ehl_cfg }, |
529 | 556 | { PCI_VDEVICE(INTEL, DID_EHL_SKU6), (kernel_ulong_t)&ehl_cfg }, |
@@ -565,6 +592,9 @@ static const struct pci_device_id igen6_pci_tbl[] = { |
565 | 592 | { PCI_VDEVICE(INTEL, DID_MTL_PS_SKU2), (kernel_ulong_t)&mtl_ps_cfg }, |
566 | 593 | { PCI_VDEVICE(INTEL, DID_MTL_PS_SKU3), (kernel_ulong_t)&mtl_ps_cfg }, |
567 | 594 | { PCI_VDEVICE(INTEL, DID_MTL_PS_SKU4), (kernel_ulong_t)&mtl_ps_cfg }, |
| 595 | + { PCI_VDEVICE(INTEL, DID_MTL_P_SKU1), (kernel_ulong_t)&mtl_p_cfg }, |
| 596 | + { PCI_VDEVICE(INTEL, DID_MTL_P_SKU2), (kernel_ulong_t)&mtl_p_cfg }, |
| 597 | + { PCI_VDEVICE(INTEL, DID_MTL_P_SKU3), (kernel_ulong_t)&mtl_p_cfg }, |
568 | 598 | { }, |
569 | 599 | }; |
570 | 600 | MODULE_DEVICE_TABLE(pci, igen6_pci_tbl); |
|
0 commit comments