From patchwork Mon Dec 16 17:48:44 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Greg KH X-Patchwork-Id: 181765 Delivered-To: patch@linaro.org Received: by 2002:ac9:44c4:0:0:0:0:0 with SMTP id t4csp4622266och; Mon, 16 Dec 2019 09:58:32 -0800 (PST) X-Google-Smtp-Source: APXvYqxdFd2n9Ee+E+hvMVEV7VtigUE2NvRkHCkTXLi8oVGF0aJLHnt7oTJdz11FW8v+5GbFWS8+ X-Received: by 2002:aca:5490:: with SMTP id i138mr155498oib.69.1576519111983; Mon, 16 Dec 2019 09:58:31 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1576519111; cv=none; d=google.com; s=arc-20160816; b=noz4ZQt53cqlvScfqll9z+XR77YC/N55XLLLjZMsaPpdWsT6ibN2JVxIvnETtKKlNu eCefVJGo2LBUy05zOUAR+qF8u6g3rGXdjo9BSjAx3YLx/FNSgofMS57jdsFEnILuHuzN Aeu9+gHl9AVN8UJhEi/CrCB5wHyGbXL0CRU24YTSyl3ow9vKUHW4f8oxYXLgooLc6aJb R7CuyKsZ3dDFrtt7VOgHOO30iHgI0Mlabz4jBBRA0YJHvS6Q5hJ1mgWeuMlzqFeDyNZI XLU6DSCFsSikFAzcMg71VrREYu1gYT9WZPTCGmi3gLJH6YKmDv0NjsQYIRo4uEzjztQd 51Ww== 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 :user-agent:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=LBhZcbYaVxamQWStaVwP5t85jEdYMufEhYMiNvHY7PQ=; b=ljZny05c/B0SmIl3A5yM+Cg68TUHsoAi1KJEs0h/Uez7TFMRXIBmMRg2hkXgaqonqF WaNtY4LIwAcKr16e/V4hWgN61Ch6e0uASt6dgaJN+F7vcM1JwkOvo9BT6B872T58ccsi PqbhfZMrE2eOZssiPZBxsoglY+raW1Lgxh7Wy3e295mzI/Ye+ott2j46cx3xuAjisbfw mTsjAv5aor3glLcjfaipzflrL7G5bN65DmC6A0cy3cGXx4JowP25N4eEfw+zHKwZajjm L+8P1oBUqMIgla6YDPWF0a+c0429Kd11f31gGWBeLdj0Y8ma0KgA/Xh3caIlnXJ8J3jf kf+A== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b="CoTP/ghA"; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id p6si10637673oig.231.2019.12.16.09.58.31; Mon, 16 Dec 2019 09:58:31 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b="CoTP/ghA"; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728616AbfLPR6a (ORCPT + 27 others); Mon, 16 Dec 2019 12:58:30 -0500 Received: from mail.kernel.org ([198.145.29.99]:58190 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728214AbfLPR6Z (ORCPT ); Mon, 16 Dec 2019 12:58:25 -0500 Received: from localhost (83-86-89-107.cable.dynamic.v4.ziggo.nl [83.86.89.107]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id CA55820733; Mon, 16 Dec 2019 17:58:24 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1576519105; bh=3UrjpHRQoSZmVLtaegrGsjNkfqQ564PJ6o7FAiDIfIE=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=CoTP/ghAWklkXyhmRQF9LoT0IO+yl7GeHY20o/HKkKoxB494OwW5U0lzcDi7C+POV HKeDdbJoxcESfTMTmtCJumEH9XdEx76w3kNMjy29l6xJN6vZvPX8mr/CLtp3Tmd2Zc y5JnyrRRkknrppNN1gjsCxHNz/1WL3bhAdrR5dVs= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Joel Stanley , =?utf-8?q?C=C3=A9dric_Le_Goater?= , Guenter Roeck , Wim Van Sebroeck , Sasha Levin Subject: [PATCH 4.14 198/267] watchdog: aspeed: Fix clock behaviour for ast2600 Date: Mon, 16 Dec 2019 18:48:44 +0100 Message-Id: <20191216174913.385533960@linuxfoundation.org> X-Mailer: git-send-email 2.24.1 In-Reply-To: <20191216174848.701533383@linuxfoundation.org> References: <20191216174848.701533383@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Joel Stanley [ Upstream commit c04571251b3d842096f1597f5d4badb508be016d ] The ast2600 no longer uses bit 4 in the control register to indicate a 1MHz clock (It now controls whether this watchdog is reset by a SOC reset). This means we do not want to set it. It also does not need to be set for the ast2500, as it is read-only on that SoC. The comment next to the clock rate selection wandered away from where it was set, so put it back next to the register setting it's describing. Fixes: b3528b487448 ("watchdog: aspeed: Add support for AST2600") Signed-off-by: Joel Stanley Reviewed-by: Cédric Le Goater Reviewed-by: Guenter Roeck Link: https://lore.kernel.org/r/20191108032905.22463-1-joel@jms.id.au Signed-off-by: Guenter Roeck Signed-off-by: Wim Van Sebroeck Signed-off-by: Sasha Levin --- drivers/watchdog/aspeed_wdt.c | 16 ++++++++++------ 1 file changed, 10 insertions(+), 6 deletions(-) -- 2.20.1 diff --git a/drivers/watchdog/aspeed_wdt.c b/drivers/watchdog/aspeed_wdt.c index cee7334b2a000..f5835cbd5d415 100644 --- a/drivers/watchdog/aspeed_wdt.c +++ b/drivers/watchdog/aspeed_wdt.c @@ -204,11 +204,6 @@ static int aspeed_wdt_probe(struct platform_device *pdev) if (IS_ERR(wdt->base)) return PTR_ERR(wdt->base); - /* - * The ast2400 wdt can run at PCLK, or 1MHz. The ast2500 only - * runs at 1MHz. We chose to always run at 1MHz, as there's no - * good reason to have a faster watchdog counter. - */ wdt->wdd.info = &aspeed_wdt_info; wdt->wdd.ops = &aspeed_wdt_ops; wdt->wdd.max_hw_heartbeat_ms = WDT_MAX_TIMEOUT_MS; @@ -224,7 +219,16 @@ static int aspeed_wdt_probe(struct platform_device *pdev) return -EINVAL; config = ofdid->data; - wdt->ctrl = WDT_CTRL_1MHZ_CLK; + /* + * On clock rates: + * - ast2400 wdt can run at PCLK, or 1MHz + * - ast2500 only runs at 1MHz, hard coding bit 4 to 1 + * - ast2600 always runs at 1MHz + * + * Set the ast2400 to run at 1MHz as it simplifies the driver. + */ + if (of_device_is_compatible(np, "aspeed,ast2400-wdt")) + wdt->ctrl = WDT_CTRL_1MHZ_CLK; /* * Control reset on a per-device basis to ensure the