Lines Matching +full:lpc +full:- +full:io +full:- +full:reg

1 // SPDX-License-Identifier: GPL-2.0-only
18 #include <asm/io.h>
37 static int edac_pci_read_dword(struct pci_dev *dev, int reg, u32 *val32) in edac_pci_read_dword() argument
41 ret = pci_read_config_dword(dev, reg, val32); in edac_pci_read_dword()
44 " PCI Access Read Error at 0x%x\n", reg); in edac_pci_read_dword()
49 static void edac_pci_read_byte(struct pci_dev *dev, int reg, u8 *val8) in edac_pci_read_byte() argument
53 ret = pci_read_config_byte(dev, reg, val8); in edac_pci_read_byte()
56 " PCI Access Read Error at 0x%x\n", reg); in edac_pci_read_byte()
59 static void edac_pci_write_dword(struct pci_dev *dev, int reg, u32 val32) in edac_pci_write_dword() argument
63 ret = pci_write_config_dword(dev, reg, val32); in edac_pci_write_dword()
66 " PCI Access Write Error at 0x%x\n", reg); in edac_pci_write_dword()
69 static void edac_pci_write_byte(struct pci_dev *dev, int reg, u8 val8) in edac_pci_write_byte() argument
73 ret = pci_write_config_byte(dev, reg, val8); in edac_pci_write_byte()
76 " PCI Access Write Error at 0x%x\n", reg); in edac_pci_write_byte()
80 * device-specific methods for amd8111 PCI Bridge Controller
88 struct pci_dev *dev = pci_info->dev; in amd8111_pci_bridge_init()
97 /* Clear CRC and Link Fail flags in HT Link Control reg */ in amd8111_pci_bridge_init()
104 /* Clear error flags in the memory-base limit reg. */ in amd8111_pci_bridge_init()
109 /* Clear Discard Timer Expired flag in Interrupt/Bridge Control reg */ in amd8111_pci_bridge_init()
126 /* Enable SSE reporting etc in Interrupt control reg */ in amd8111_pci_bridge_init()
136 struct pci_dev *dev = pci_info->dev; in amd8111_pci_bridge_exit()
149 /* Disable DTSERREN/MARSP/SERREN in Interrupt Control reg */ in amd8111_pci_bridge_exit()
158 struct amd8111_pci_info *pci_info = edac_dev->pvt_info; in amd8111_pci_bridge_check()
159 struct pci_dev *dev = pci_info->dev; in amd8111_pci_bridge_check()
166 "register on device %s\n", pci_info->ctl_name); in amd8111_pci_bridge_check()
175 edac_pci_handle_npe(edac_dev, edac_dev->ctl_name); in amd8111_pci_bridge_check()
182 "register on device %s\n", pci_info->ctl_name); in amd8111_pci_bridge_check()
189 edac_pci_handle_npe(edac_dev, edac_dev->ctl_name); in amd8111_pci_bridge_check()
196 "register on device %s\n", pci_info->ctl_name); in amd8111_pci_bridge_check()
203 edac_pci_handle_npe(edac_dev, edac_dev->ctl_name); in amd8111_pci_bridge_check()
206 /* Check out PCI Bridge Memory Base-Limit Register */ in amd8111_pci_bridge_check()
211 pci_info->ctl_name); in amd8111_pci_bridge_check()
224 edac_pci_handle_npe(edac_dev, edac_dev->ctl_name); in amd8111_pci_bridge_check()
232 /* device-specific methods for amd8111 LPC Bridge device */
236 struct pci_dev *dev = dev_info->dev; in amd8111_lpc_bridge_init()
264 /* Second clear error flags on LPC bridge */ in amd8111_lpc_bridge_init()
278 struct amd8111_dev_info *dev_info = edac_dev->pvt_info; in amd8111_lpc_bridge_check()
279 struct pci_dev *dev = dev_info->dev; in amd8111_lpc_bridge_check()
285 "Error(s) in IO control register on %s device\n", in amd8111_lpc_bridge_check()
286 dev_info->ctl_name); in amd8111_lpc_bridge_check()
287 printk(KERN_INFO "LPC ERR: %d, PW2LPC: %d\n", in amd8111_lpc_bridge_check()
294 edac_device_handle_ue(edac_dev, 0, 0, edac_dev->ctl_name); in amd8111_lpc_bridge_check()
307 edac_dev->ctl_name); in amd8111_lpc_bridge_check()
316 .ctl_name = "lpc",
339 struct amd8111_dev_info *dev_info = &amd8111_devices[id->driver_data]; in amd8111_dev_probe()
340 int ret = -ENODEV; in amd8111_dev_probe()
342 dev_info->dev = pci_get_device(PCI_VENDOR_ID_AMD, in amd8111_dev_probe()
343 dev_info->err_dev, NULL); in amd8111_dev_probe()
345 if (!dev_info->dev) { in amd8111_dev_probe()
348 PCI_VENDOR_ID_AMD, dev_info->err_dev, in amd8111_dev_probe()
349 dev_info->ctl_name); in amd8111_dev_probe()
353 if (pci_enable_device(dev_info->dev)) { in amd8111_dev_probe()
356 PCI_VENDOR_ID_AMD, dev_info->err_dev, in amd8111_dev_probe()
357 dev_info->ctl_name); in amd8111_dev_probe()
366 dev_info->edac_idx = edac_device_alloc_index(); in amd8111_dev_probe()
367 dev_info->edac_dev = in amd8111_dev_probe()
368 edac_device_alloc_ctl_info(0, dev_info->ctl_name, 1, in amd8111_dev_probe()
370 NULL, 0, dev_info->edac_idx); in amd8111_dev_probe()
371 if (!dev_info->edac_dev) { in amd8111_dev_probe()
372 ret = -ENOMEM; in amd8111_dev_probe()
376 dev_info->edac_dev->pvt_info = dev_info; in amd8111_dev_probe()
377 dev_info->edac_dev->dev = &dev_info->dev->dev; in amd8111_dev_probe()
378 dev_info->edac_dev->mod_name = AMD8111_EDAC_MOD_STR; in amd8111_dev_probe()
379 dev_info->edac_dev->ctl_name = dev_info->ctl_name; in amd8111_dev_probe()
380 dev_info->edac_dev->dev_name = dev_name(&dev_info->dev->dev); in amd8111_dev_probe()
383 dev_info->edac_dev->edac_check = dev_info->check; in amd8111_dev_probe()
385 if (dev_info->init) in amd8111_dev_probe()
386 dev_info->init(dev_info); in amd8111_dev_probe()
388 if (edac_device_add_device(dev_info->edac_dev) > 0) { in amd8111_dev_probe()
390 dev_info->ctl_name); in amd8111_dev_probe()
396 PCI_VENDOR_ID_AMD, dev_info->err_dev, in amd8111_dev_probe()
397 dev_info->ctl_name); in amd8111_dev_probe()
402 edac_device_free_ctl_info(dev_info->edac_dev); in amd8111_dev_probe()
404 pci_dev_put(dev_info->dev); in amd8111_dev_probe()
413 for (dev_info = amd8111_devices; dev_info->err_dev; dev_info++) in amd8111_dev_remove()
414 if (dev_info->dev->device == dev->device) in amd8111_dev_remove()
417 if (!dev_info->err_dev) /* should never happen */ in amd8111_dev_remove()
420 if (dev_info->edac_dev) { in amd8111_dev_remove()
421 edac_device_del_device(dev_info->edac_dev->dev); in amd8111_dev_remove()
422 edac_device_free_ctl_info(dev_info->edac_dev); in amd8111_dev_remove()
425 if (dev_info->exit) in amd8111_dev_remove()
426 dev_info->exit(dev_info); in amd8111_dev_remove()
428 pci_dev_put(dev_info->dev); in amd8111_dev_remove()
434 struct amd8111_pci_info *pci_info = &amd8111_pcis[id->driver_data]; in amd8111_pci_probe()
435 int ret = -ENODEV; in amd8111_pci_probe()
437 pci_info->dev = pci_get_device(PCI_VENDOR_ID_AMD, in amd8111_pci_probe()
438 pci_info->err_dev, NULL); in amd8111_pci_probe()
440 if (!pci_info->dev) { in amd8111_pci_probe()
443 PCI_VENDOR_ID_AMD, pci_info->err_dev, in amd8111_pci_probe()
444 pci_info->ctl_name); in amd8111_pci_probe()
448 if (pci_enable_device(pci_info->dev)) { in amd8111_pci_probe()
451 PCI_VENDOR_ID_AMD, pci_info->err_dev, in amd8111_pci_probe()
452 pci_info->ctl_name); in amd8111_pci_probe()
461 pci_info->edac_idx = edac_pci_alloc_index(); in amd8111_pci_probe()
462 pci_info->edac_dev = edac_pci_alloc_ctl_info(0, pci_info->ctl_name); in amd8111_pci_probe()
463 if (!pci_info->edac_dev) { in amd8111_pci_probe()
464 ret = -ENOMEM; in amd8111_pci_probe()
468 pci_info->edac_dev->pvt_info = pci_info; in amd8111_pci_probe()
469 pci_info->edac_dev->dev = &pci_info->dev->dev; in amd8111_pci_probe()
470 pci_info->edac_dev->mod_name = AMD8111_EDAC_MOD_STR; in amd8111_pci_probe()
471 pci_info->edac_dev->ctl_name = pci_info->ctl_name; in amd8111_pci_probe()
472 pci_info->edac_dev->dev_name = dev_name(&pci_info->dev->dev); in amd8111_pci_probe()
475 pci_info->edac_dev->edac_check = pci_info->check; in amd8111_pci_probe()
477 if (pci_info->init) in amd8111_pci_probe()
478 pci_info->init(pci_info); in amd8111_pci_probe()
480 if (edac_pci_add_device(pci_info->edac_dev, pci_info->edac_idx) > 0) { in amd8111_pci_probe()
482 pci_info->ctl_name); in amd8111_pci_probe()
488 PCI_VENDOR_ID_AMD, pci_info->err_dev, in amd8111_pci_probe()
489 pci_info->ctl_name); in amd8111_pci_probe()
494 edac_pci_free_ctl_info(pci_info->edac_dev); in amd8111_pci_probe()
496 pci_dev_put(pci_info->dev); in amd8111_pci_probe()
505 for (pci_info = amd8111_pcis; pci_info->err_dev; pci_info++) in amd8111_pci_remove()
506 if (pci_info->dev->device == dev->device) in amd8111_pci_remove()
509 if (!pci_info->err_dev) /* should never happen */ in amd8111_pci_remove()
512 if (pci_info->edac_dev) { in amd8111_pci_remove()
513 edac_pci_del_device(pci_info->edac_dev->dev); in amd8111_pci_remove()
514 edac_pci_free_ctl_info(pci_info->edac_dev); in amd8111_pci_remove()
517 if (pci_info->exit) in amd8111_pci_remove()
518 pci_info->exit(pci_info); in amd8111_pci_remove()
520 pci_dev_put(pci_info->dev); in amd8111_pci_remove()
535 } /* table is NULL-terminated */
558 } /* table is NULL-terminated */