Date: Tue, 12 Apr 2016 07:54:03 +0000 (UTC) From: Alexander Motin <mav@FreeBSD.org> To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r297851 - in stable/10: share/man/man4 sys/dev/amdsbwd Message-ID: <201604120754.u3C7s3HJ098109@repo.freebsd.org>
next in thread | raw e-mail | index | archive | help
Author: mav Date: Tue Apr 12 07:54:03 2016 New Revision: 297851 URL: https://svnweb.freebsd.org/changeset/base/297851 Log: MFC r297386: Add support for AMD FCH watchdog timers. Modified: stable/10/share/man/man4/amdsbwd.4 stable/10/sys/dev/amdsbwd/amdsbwd.c Directory Properties: stable/10/ (props changed) Modified: stable/10/share/man/man4/amdsbwd.4 ============================================================================== --- stable/10/share/man/man4/amdsbwd.4 Tue Apr 12 07:21:22 2016 (r297850) +++ stable/10/share/man/man4/amdsbwd.4 Tue Apr 12 07:54:03 2016 (r297851) @@ -25,12 +25,12 @@ .\" .\" $FreeBSD$ .\" -.Dd June 7, 2011 +.Dd March 29, 2016 .Dt AMDSBWD 4 .Os .Sh NAME .Nm amdsbwd -.Nd device driver for the AMD SB600/SB7xx/SB8xx watchdog timers +.Nd device driver for the AMD southbridge watchdog timers .Sh SYNOPSIS To compile this driver into the kernel, place the following line in your @@ -51,7 +51,7 @@ The driver provides .Xr watchdog 4 support for the watchdog timers present on -AMD SB600, SB7xx and SB8xx southbridges. +AMD SB600, SB7xx, SB8xx and SB9xx southbridges and Axx FCHs. .Sh SEE ALSO .Xr watchdog 4 , .Xr watchdog 8 , Modified: stable/10/sys/dev/amdsbwd/amdsbwd.c ============================================================================== --- stable/10/sys/dev/amdsbwd/amdsbwd.c Tue Apr 12 07:21:22 2016 (r297850) +++ stable/10/sys/dev/amdsbwd/amdsbwd.c Tue Apr 12 07:54:03 2016 (r297851) @@ -106,6 +106,8 @@ __FBSDID("$FreeBSD$"); /* SB7xx RRG 2.3.1.1, SB600 RRG 2.3.1.1, SB8xx RRG 2.3.1. */ #define AMDSB_SMBUS_DEVID 0x43851002 #define AMDSB8_SMBUS_REVID 0x40 +#define AMDHUDSON_SMBUS_DEVID 0x780b1022 +#define AMDKERNCZ_SMBUS_DEVID 0x790b1022 #define amdsbwd_verbose_printf(dev, ...) \ do { \ @@ -279,7 +281,9 @@ amdsbwd_identify(driver_t *driver, devic smb_dev = pci_find_bsf(0, 20, 0); if (smb_dev == NULL) return; - if (pci_get_devid(smb_dev) != AMDSB_SMBUS_DEVID) + if (pci_get_devid(smb_dev) != AMDSB_SMBUS_DEVID && + pci_get_devid(smb_dev) != AMDHUDSON_SMBUS_DEVID && + pci_get_devid(smb_dev) != AMDKERNCZ_SMBUS_DEVID) return; child = BUS_ADD_CHILD(parent, ISA_ORDER_SPECULATIVE, "amdsbwd", -1); @@ -309,10 +313,12 @@ amdsbwd_probe_sb7xx(device_t dev, struct *addr <<= 8; *addr |= pmio_read(pmres, AMDSB_PM_WDT_BASE_MSB - i); } + *addr &= ~0x07u; + /* Set watchdog timer tick to 1s. */ val = pmio_read(pmres, AMDSB_PM_WDT_CTRL); val &= ~AMDSB_WDT_RES_MASK; - val |= AMDSB_WDT_RES_10MS; + val |= AMDSB_WDT_RES_1S; pmio_write(pmres, AMDSB_PM_WDT_CTRL, val); /* Enable watchdog device (in stopped state). */ @@ -372,7 +378,7 @@ amdsbwd_probe_sb8xx(device_t dev, struct val = pmio_read(pmres, AMDSB8_PM_WDT_EN); device_printf(dev, "AMDSB8_PM_WDT_EN value = %#02x\n", val); #endif - device_set_desc(dev, "AMD SB8xx Watchdog Timer"); + device_set_desc(dev, "AMD SB8xx/SB9xx/Axx Watchdog Timer"); } static int @@ -404,7 +410,8 @@ amdsbwd_probe(device_t dev) smb_dev = pci_find_bsf(0, 20, 0); KASSERT(smb_dev != NULL, ("can't find SMBus PCI device\n")); - if (pci_get_revid(smb_dev) < AMDSB8_SMBUS_REVID) + if (pci_get_devid(smb_dev) == AMDSB_SMBUS_DEVID && + pci_get_revid(smb_dev) < AMDSB8_SMBUS_REVID) amdsbwd_probe_sb7xx(dev, res, &addr); else amdsbwd_probe_sb8xx(dev, res, &addr); @@ -440,10 +447,7 @@ amdsbwd_attach_sb(device_t dev, struct a smb_dev = pci_find_bsf(0, 20, 0); KASSERT(smb_dev != NULL, ("can't find SMBus PCI device\n")); - if (pci_get_revid(smb_dev) < AMDSB8_SMBUS_REVID) - sc->ms_per_tick = 10; - else - sc->ms_per_tick = 1000; + sc->ms_per_tick = 1000; sc->res_ctrl = bus_alloc_resource_any(dev, SYS_RES_MEMORY, &sc->rid_ctrl, RF_ACTIVE);
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201604120754.u3C7s3HJ098109>