Received: by 2002:a05:6a10:22f:0:0:0:0 with SMTP id 15csp1215553pxk; Thu, 10 Sep 2020 09:44:51 -0700 (PDT) X-Google-Smtp-Source: ABdhPJy24FrEKo/aJNAddqoBozjzuKGwT0mL2/aFeOROrTQC19Iwd2Jy2X25cZ9Gze9LXSYPrWlE X-Received: by 2002:a17:906:a88a:: with SMTP id ha10mr10518567ejb.532.1599756291626; Thu, 10 Sep 2020 09:44:51 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1599756291; cv=none; d=google.com; s=arc-20160816; b=aqDHlF1704Q9QvXVrdeg636Ag9FTEK8WNP/EO2u06ngqBjdX1w6ENRxUSY5P/dtFVJ I88/8ML/Kd1CrWamYx5LSAHdQfAxSuBEZz5UPyWVQImHkAMzfnzyQ3lyudMLJ60E8SU/ G9yb9IxnBc7nHTE/CE21y0hicoxKHclNzYQOYBiEMBkP2sP/e4l6GMm2y/YkUd+JERME EGr2RLT9lKCEOztoLTviTWpOXGb6qKKRWbdTdVKSXKWpx520XpNtcbgeKkbe5jSJ8o+D mtfqFxb29D2Fav8YFnizH4FqjrQVU6McuwFJhB9v/DoNQHlRjXh4nzHZvyjzgZLYtQ06 A9fw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=b5HSsnTUYAyklmliYSmi70GefBQKCXs49AU2eEjqYEk=; b=qLwP7hchJX1sVNX0i7Zgd7x8TwEisJQVP21jNuQTMJj7ImDskouDyw2LRNbtQ/FaDb I5ifL5+xYxQnafn2dJQc7iewQFSJqNosHW8LrlHEG0r8IjJYnUDerUAcXOrUgRejWsZr Gk/q00eQVKE/CANYF2BStOBW4CNnc9Y7G9+50VccSQWcflTWf0e0kXB5HPbzQnYroQcl WR1s9uweSs8aqymCl9u8De/cHie5MDA4l3kX/MscBpTKZPhtjhj+fw5g/iVbAzWb3ROB qZAbW/7WBt6Km40eOSx00bv8JX7jk4dMutwDv1C/Nw8rfAT6CPNvZqhd4lcaRHnCNfbq kY0g== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@gmail.com header.s=20161025 header.b=Pm5FGPbI; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id q21si3846282eds.392.2020.09.10.09.44.28; Thu, 10 Sep 2020 09:44:51 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=fail header.i=@gmail.com header.s=20161025 header.b=Pm5FGPbI; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726755AbgIJQlf (ORCPT + 99 others); Thu, 10 Sep 2020 12:41:35 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:47864 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726893AbgIJQie (ORCPT ); Thu, 10 Sep 2020 12:38:34 -0400 Received: from mail-ot1-x342.google.com (mail-ot1-x342.google.com [IPv6:2607:f8b0:4864:20::342]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 817E7C0617A0; Thu, 10 Sep 2020 09:31:14 -0700 (PDT) Received: by mail-ot1-x342.google.com with SMTP id o6so5887073ota.2; Thu, 10 Sep 2020 09:31:14 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=sender:from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=b5HSsnTUYAyklmliYSmi70GefBQKCXs49AU2eEjqYEk=; b=Pm5FGPbIPrFsFV++auvl1XmZ/1T7mALPkXouY23OS5lb6v/q3uNwPjHR/vwovx2gGJ t5LQ/b74W67zhU7G9mvdb7VSmpIkRJwsoqCsrQgBJJiBVp0vp5fpJQW4TZ8DUkKGa+nX kEw+hiSMAp7eqbhRjtqJchKfT5ycbWba2s+4NHDHJwAs1LKqeolZs83Zb7aw11dcJoJz rKqOXscJglpz4kMAYYr6etUgYCXmyYkCwk8Y9gf/OfAP8WALwt6PO/0vN9sShe32618+ SBaO5UwotcRKCAmkGchfjQKRm/3j7JtK/XT5Vqo1OZe23sl8XLiIJ9sQKZ1sOjyjE2Cj K7ZQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:sender:from:to:cc:subject:date:message-id :in-reply-to:references:mime-version:content-transfer-encoding; bh=b5HSsnTUYAyklmliYSmi70GefBQKCXs49AU2eEjqYEk=; b=kpPLg6k3TouL0C/LyxpvIzVZ4o2cHJXmrMfFVJpdANnfZNMii0aKFSnFR5SzeoUd7I 9EhnrYLoHFWPask1cRq6rVLTwXmD6tV3EnL2M8iVSgkX8F/FtN9/adkqIaOcXs3XimwY m+Zd14DbUIDIJORCch5M0nxQ5SA9fNUV3AC1HdQSJgx9FroNOJhzFLK8MUNJ+Tob97MT q20Msmza6a14d5Z3rwSb3dgAwFA8AbxT5aLKK+jD96Tr1t+mA21gg4/XHh1NCy4OWz0y hlRFU41Md+ZAY1YjXqBd1gUIFT4PZqbhsM97NWABB+jqsfxC72kjcWSWTxMHK29TqtS8 98hQ== X-Gm-Message-State: AOAM533smY2cgumRsaoTNkpNd3j89GZMDPEK2lzJCYJWFD2j37+rVusj /8UcyjgMFR2lA5Dk82lhI7s= X-Received: by 2002:a9d:5509:: with SMTP id l9mr4835134oth.154.1599755473965; Thu, 10 Sep 2020 09:31:13 -0700 (PDT) Received: from localhost ([2600:1700:e321:62f0:329c:23ff:fee3:9d7c]) by smtp.gmail.com with ESMTPSA id w136sm979394oif.14.2020.09.10.09.31.13 (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Thu, 10 Sep 2020 09:31:13 -0700 (PDT) From: Guenter Roeck To: Wim Van Sebroeck Cc: linux-watchdog@vger.kernel.org, linux-kernel@vger.kernel.org, Guenter Roeck , Jan Kiszka Subject: [PATCH 2/2] watchdog: sp5100_tco: Enable watchdog on Family 17h devices if disabled Date: Thu, 10 Sep 2020 09:31:09 -0700 Message-Id: <20200910163109.235136-2-linux@roeck-us.net> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20200910163109.235136-1-linux@roeck-us.net> References: <20200910163109.235136-1-linux@roeck-us.net> MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Family 17h (Ryzen) devices, the WatchdogTmrEn bit of PmDecodeEn not only enables watchdog memory decoding at 0xfeb00000, it also enables the watchdog hardware itself. Use this information to enable the watchdog if it is not already enabled. Cc: Jan Kiszka Signed-off-by: Guenter Roeck --- drivers/watchdog/sp5100_tco.c | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) diff --git a/drivers/watchdog/sp5100_tco.c b/drivers/watchdog/sp5100_tco.c index 85e9664318c9..a730ecbf78cd 100644 --- a/drivers/watchdog/sp5100_tco.c +++ b/drivers/watchdog/sp5100_tco.c @@ -17,6 +17,12 @@ * AMD Publication 51192 "AMD Bolton FCH Register Reference Guide" * AMD Publication 52740 "BIOS and Kernel Developer’s Guide (BKDG) * for AMD Family 16h Models 30h-3Fh Processors" + * AMD Publication 55570-B1-PUB "Processor Programming Reference (PPR) + * for AMD Family 17h Model 18h, Revision B1 + * Processors (PUB) + * AMD Publication 55772-A1-PUB "Processor Programming Reference (PPR) + * for AMD Family 17h Model 20h, Revision A1 + * Processors (PUB) */ /* @@ -241,6 +247,18 @@ static int sp5100_tco_setupdevice(struct device *dev, break; case efch: dev_name = SB800_DEVNAME; + /* + * On Family 17h devices, the EFCH_PM_DECODEEN_WDT_TMREN bit of + * EFCH_PM_DECODEEN not only enables the EFCH_PM_WDT_ADDR memory + * region, it also enables the watchdog itself. + */ + if (boot_cpu_data.x86 == 0x17) { + val = sp5100_tco_read_pm_reg8(EFCH_PM_DECODEEN); + if (!(val & EFCH_PM_DECODEEN_WDT_TMREN)) { + sp5100_tco_update_pm_reg8(EFCH_PM_DECODEEN, 0xff, + EFCH_PM_DECODEEN_WDT_TMREN); + } + } val = sp5100_tco_read_pm_reg8(EFCH_PM_DECODEEN); if (val & EFCH_PM_DECODEEN_WDT_TMREN) mmio_addr = EFCH_PM_WDT_ADDR; -- 2.17.1