.. | .. |
---|
| 1 | +// SPDX-License-Identifier: GPL-2.0-or-later |
---|
1 | 2 | /* |
---|
2 | 3 | * sp5100_tco : TCO timer driver for sp5100 chipsets |
---|
3 | 4 | * |
---|
.. | .. |
---|
6 | 7 | * Based on i8xx_tco.c: |
---|
7 | 8 | * (c) Copyright 2000 kernel concepts <nils@kernelconcepts.de>, All Rights |
---|
8 | 9 | * Reserved. |
---|
9 | | - * http://www.kernelconcepts.de |
---|
10 | | - * |
---|
11 | | - * This program is free software; you can redistribute it and/or |
---|
12 | | - * modify it under the terms of the GNU General Public License |
---|
13 | | - * as published by the Free Software Foundation; either version |
---|
14 | | - * 2 of the License, or (at your option) any later version. |
---|
| 10 | + * https://www.kernelconcepts.de |
---|
15 | 11 | * |
---|
16 | 12 | * See AMD Publication 43009 "AMD SB700/710/750 Register Reference Guide", |
---|
17 | 13 | * AMD Publication 45482 "AMD SB800-Series Southbridges Register |
---|
.. | .. |
---|
21 | 17 | * AMD Publication 51192 "AMD Bolton FCH Register Reference Guide" |
---|
22 | 18 | * AMD Publication 52740 "BIOS and Kernel Developer’s Guide (BKDG) |
---|
23 | 19 | * for AMD Family 16h Models 30h-3Fh Processors" |
---|
| 20 | + * AMD Publication 55570-B1-PUB "Processor Programming Reference (PPR) |
---|
| 21 | + * for AMD Family 17h Model 18h, Revision B1 |
---|
| 22 | + * Processors (PUB) |
---|
| 23 | + * AMD Publication 55772-A1-PUB "Processor Programming Reference (PPR) |
---|
| 24 | + * for AMD Family 17h Model 20h, Revision A1 |
---|
| 25 | + * Processors (PUB) |
---|
24 | 26 | */ |
---|
25 | 27 | |
---|
26 | 28 | /* |
---|
.. | .. |
---|
245 | 247 | break; |
---|
246 | 248 | case efch: |
---|
247 | 249 | dev_name = SB800_DEVNAME; |
---|
| 250 | + /* |
---|
| 251 | + * On Family 17h devices, the EFCH_PM_DECODEEN_WDT_TMREN bit of |
---|
| 252 | + * EFCH_PM_DECODEEN not only enables the EFCH_PM_WDT_ADDR memory |
---|
| 253 | + * region, it also enables the watchdog itself. |
---|
| 254 | + */ |
---|
| 255 | + if (boot_cpu_data.x86 == 0x17) { |
---|
| 256 | + val = sp5100_tco_read_pm_reg8(EFCH_PM_DECODEEN); |
---|
| 257 | + if (!(val & EFCH_PM_DECODEEN_WDT_TMREN)) { |
---|
| 258 | + sp5100_tco_update_pm_reg8(EFCH_PM_DECODEEN, 0xff, |
---|
| 259 | + EFCH_PM_DECODEEN_WDT_TMREN); |
---|
| 260 | + } |
---|
| 261 | + } |
---|
248 | 262 | val = sp5100_tco_read_pm_reg8(EFCH_PM_DECODEEN); |
---|
249 | 263 | if (val & EFCH_PM_DECODEEN_WDT_TMREN) |
---|
250 | 264 | mmio_addr = EFCH_PM_WDT_ADDR; |
---|
.. | .. |
---|
395 | 409 | wdd->min_timeout = 1; |
---|
396 | 410 | wdd->max_timeout = 0xffff; |
---|
397 | 411 | |
---|
398 | | - if (watchdog_init_timeout(wdd, heartbeat, NULL)) |
---|
399 | | - dev_info(dev, "timeout value invalid, using %d\n", |
---|
400 | | - wdd->timeout); |
---|
| 412 | + watchdog_init_timeout(wdd, heartbeat, NULL); |
---|
401 | 413 | watchdog_set_nowayout(wdd, nowayout); |
---|
402 | 414 | watchdog_stop_on_reboot(wdd); |
---|
403 | 415 | watchdog_stop_on_unregister(wdd); |
---|
.. | .. |
---|
408 | 420 | return ret; |
---|
409 | 421 | |
---|
410 | 422 | ret = devm_watchdog_register_device(dev, wdd); |
---|
411 | | - if (ret) { |
---|
412 | | - dev_err(dev, "cannot register watchdog device (err=%d)\n", ret); |
---|
| 423 | + if (ret) |
---|
413 | 424 | return ret; |
---|
414 | | - } |
---|
415 | 425 | |
---|
416 | 426 | /* Show module parameters */ |
---|
417 | 427 | dev_info(dev, "initialized. heartbeat=%d sec (nowayout=%d)\n", |
---|