Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

Watchdog: sp5100_tco: Enable Family 17h+ CPUs

The driver currently uses a CPU family match of 17h to determine
EFCH_PM_DECODEEN_WDT_TMREN register support. This family check will not
support future AMD CPUs and instead will require driver updates to add
support.

Remove the family 17h family check and add a check for SMBus PCI
revision ID 0x51 or greater. The MMIO access method has been available
since at least SMBus controllers using PCI revision 0x51. This revision
check will support family 17h and future AMD processors including EFCH
functionality without requiring driver changes.

Co-developed-by: Robert Richter <rrichter@amd.com>
Signed-off-by: Robert Richter <rrichter@amd.com>
Signed-off-by: Terry Bowman <terry.bowman@amd.com>
Tested-by: Jean Delvare <jdelvare@suse.de>
Reviewed-by: Jean Delvare <jdelvare@suse.de>
Reviewed-by: Guenter Roeck <linux@roeck-us.net>
Link: https://lore.kernel.org/r/20220202153525.1693378-5-terry.bowman@amd.com
Signed-off-by: Guenter Roeck <linux@roeck-us.net>
Signed-off-by: Wim Van Sebroeck <wim@linux-watchdog.org>

authored by

Terry Bowman and committed by
Wim Van Sebroeck
82627037 0578fff4

+5 -12
+4 -12
drivers/watchdog/sp5100_tco.c
··· 87 87 dev->revision < 0x40) { 88 88 return sp5100; 89 89 } else if (dev->vendor == PCI_VENDOR_ID_AMD && 90 + sp5100_tco_pci->device == PCI_DEVICE_ID_AMD_KERNCZ_SMBUS && 91 + sp5100_tco_pci->revision >= AMD_ZEN_SMBUS_PCI_REV) { 92 + return efch_mmio; 93 + } else if (dev->vendor == PCI_VENDOR_ID_AMD && 90 94 ((dev->device == PCI_DEVICE_ID_AMD_HUDSON2_SMBUS && 91 95 dev->revision >= 0x41) || 92 96 (dev->device == PCI_DEVICE_ID_AMD_KERNCZ_SMBUS && ··· 463 459 break; 464 460 case efch: 465 461 dev_name = SB800_DEVNAME; 466 - /* 467 - * On Family 17h devices, the EFCH_PM_DECODEEN_WDT_TMREN bit of 468 - * EFCH_PM_DECODEEN not only enables the EFCH_PM_WDT_ADDR memory 469 - * region, it also enables the watchdog itself. 470 - */ 471 - if (boot_cpu_data.x86 == 0x17) { 472 - val = sp5100_tco_read_pm_reg8(EFCH_PM_DECODEEN); 473 - if (!(val & EFCH_PM_DECODEEN_WDT_TMREN)) { 474 - sp5100_tco_update_pm_reg8(EFCH_PM_DECODEEN, 0xff, 475 - EFCH_PM_DECODEEN_WDT_TMREN); 476 - } 477 - } 478 462 val = sp5100_tco_read_pm_reg8(EFCH_PM_DECODEEN); 479 463 if (val & EFCH_PM_DECODEEN_WDT_TMREN) 480 464 mmio_addr = EFCH_PM_WDT_ADDR;
+1
drivers/watchdog/sp5100_tco.h
··· 89 89 #define EFCH_PM_ACPI_MMIO_PM_ADDR (EFCH_PM_ACPI_MMIO_ADDR + \ 90 90 EFCH_PM_ACPI_MMIO_PM_OFFSET) 91 91 #define EFCH_PM_ACPI_MMIO_PM_SIZE 8 92 + #define AMD_ZEN_SMBUS_PCI_REV 0x51