From patchwork Sat Aug 12 18:43:08 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Linus Walleij X-Patchwork-Id: 109931 Delivered-To: patch@linaro.org Received: by 10.140.95.78 with SMTP id h72csp2442231qge; Sat, 12 Aug 2017 11:43:31 -0700 (PDT) X-Received: by 10.98.71.88 with SMTP id u85mr17165213pfa.185.1502563411818; Sat, 12 Aug 2017 11:43:31 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1502563411; cv=none; d=google.com; s=arc-20160816; b=xlbmY4mUuK0QTX1nXncso8J+8/uH/wgH8K0RN/edI0APcIQhSomSQt0cJ4tsBWFtpi uexP6owd0+kwESgvFg15/QPl7+mhhdND+p1Psn1Sco0TiLtEuVMwOJEWdQC9TjWgpIvp eeJOmOyci2S+jVVMu7RAp3+55rnhPPZuJ0dkZ3A4HIlPZTzihfoqASWs6eFNtLjJeLCN fARFB9II7Jf2DFsvZdRpZfj6tm/QlTnaNraKp8ac2TXkQHVuDRAxmntXZB1syO8PtGV0 BOWtV+vx1jCNHF4kL+GbZbg+SgEqhM0LcTwPh6Dnj2/1JloFGJcoP5MMNH3UOGDXbEnT y4bA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:references:in-reply-to:message-id:date :subject:cc:to:from:dkim-signature:arc-authentication-results; bh=y/ZLzx6FQZ7790uK+zuEiC9dfRtTdSMdmty4bl6hfq0=; b=HkYSZGy8J2UNggnG9PEfL5GHh+Pp6XuhPG975/eKtCecnujY7ntJKgqW5ZpVS5ccc4 bzSUgWLG0RgjkacVhNl1CP/K4mP+ikT4pqpizMLhErgSFhwwrknfA10gF47qVZ9yG7Zc Ur9gIv/aEWCSEBGKGBimXBjcuEe8fCnryVRijbWKAIxHCDIaQ6fnFNaB1T5lvRj0sS0N e+TXAjlKaXLXibUtWGWibfKbNaGQyEwlnL1Ml4zgcw/el1vmOk9wFAwH6EGmBM4teQ7z oY7SSkYkkglSG42HCLTHDR7kzVl5lD2lGZb6WDPEh3sUrjjzmbYjGgwKad0PsyhF6Luz ew3g== ARC-Authentication-Results: i=1; mx.google.com; dkim=neutral (body hash did not verify) header.i=@linaro.org header.s=google header.b=KYCkCgeM; spf=pass (google.com: best guess record for domain of linux-watchdog-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-watchdog-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id q198si2051057pfq.531.2017.08.12.11.43.31 for ; Sat, 12 Aug 2017 11:43:31 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-watchdog-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=neutral (body hash did not verify) header.i=@linaro.org header.s=google header.b=KYCkCgeM; spf=pass (google.com: best guess record for domain of linux-watchdog-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-watchdog-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751100AbdHLSnb (ORCPT ); Sat, 12 Aug 2017 14:43:31 -0400 Received: from mail-lf0-f43.google.com ([209.85.215.43]:36884 "EHLO mail-lf0-f43.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750948AbdHLSna (ORCPT ); Sat, 12 Aug 2017 14:43:30 -0400 Received: by mail-lf0-f43.google.com with SMTP id m86so26896360lfi.4 for ; Sat, 12 Aug 2017 11:43:30 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=KoSiR3+3r+IZ0NfrrnKPi/qaa8Sg05/8f2teIbAbcIE=; b=KYCkCgeMJnM6pCgDw6GQ2CkCbNaTFrt+RBloGk8X1Fnjmr1dotBLQaDCSFEsQsVrOK Liivv5BDHe8yWl+vXjyQzSZrMtve2XarIcsdb0FLTG5W+TvzNfi2/1EiBdj8vBfHNYUl mKHfQEsx1lhqJ0j5DhkAVgGA/6II0R2poaVzk= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=KoSiR3+3r+IZ0NfrrnKPi/qaa8Sg05/8f2teIbAbcIE=; b=Ioz+7kcLyz9pOmNvdzP4EJph8iYJ7IC9XE0ubHczwCEoIzSZVUdca+iT9MRXUwlemD d8JfHyhDxqMfGy/VtgsDodCXAIhyqr58pH3CCNGMdVzedIX9+taTSjVD3PtzkRN/9AD5 4jyhc++jZHw0qRANqL3Hn5tThuglWUi/rQSU4P5kpuhp4utIrf/iKSyWQ0clcQ+m3a4p NTTFJRwH032C/b3wBAOuem5pywsBdUANEgHUQjyvmtBV3eKuPrBRBkyOpCtUY07IURB7 TRUFbdnezffv8Y9aWSdMSCPhzKZyhLm+MEQpaYaB90nNqaC3xB/jjs02Ooe0PurZyhVU czCA== X-Gm-Message-State: AHYfb5g2hcSC9GqHio3ZUN0jDOSesCUf3CEWquZzNjpNHOHKMeAzm0cV HsBbtC/FG56UMn3l X-Received: by 10.25.29.83 with SMTP id d80mr7087382lfd.50.1502563409293; Sat, 12 Aug 2017 11:43:29 -0700 (PDT) Received: from fabina.bredbandsbolaget.se (c-277e71d5.014-348-6c756e10.cust.bredbandsbolaget.se. [213.113.126.39]) by smtp.gmail.com with ESMTPSA id d64sm696628lfg.22.2017.08.12.11.43.27 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Sat, 12 Aug 2017 11:43:27 -0700 (PDT) From: Linus Walleij To: Wim Van Sebroeck , Guenter Roeck , Jonas Jensen , Andrew Jeffery , Joel Stanley Cc: linux-arm-kernel@lists.infradead.org, linux-watchdog@vger.kernel.org, Linus Walleij , devicetree@vger.kernel.org Subject: [PATCH 01/11] watchdog: gemini/ftwdt010: rename DT bindings Date: Sat, 12 Aug 2017 20:43:08 +0200 Message-Id: <20170812184318.10144-2-linus.walleij@linaro.org> X-Mailer: git-send-email 2.13.4 In-Reply-To: <20170812184318.10144-1-linus.walleij@linaro.org> References: <20170812184318.10144-1-linus.walleij@linaro.org> Sender: linux-watchdog-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-watchdog@vger.kernel.org The device tree bindings are in two copies and also should be consolidated into a single Faraday Technology FTWDT010 binding since we uncovered that this IP part is a standard IP from Faraday. Cc: devicetree@vger.kernel.org Signed-off-by: Linus Walleij --- .../bindings/watchdog/cortina,gemini-watchdog.txt | 17 ----------------- ...{cortina,gemin-watchdog.txt => faraday,ftwdt010.txt} | 11 ++++++++--- 2 files changed, 8 insertions(+), 20 deletions(-) delete mode 100644 Documentation/devicetree/bindings/watchdog/cortina,gemini-watchdog.txt rename Documentation/devicetree/bindings/watchdog/{cortina,gemin-watchdog.txt => faraday,ftwdt010.txt} (55%) -- 2.13.4 -- To unsubscribe from this list: send the line "unsubscribe linux-watchdog" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Acked-by: Rob Herring diff --git a/Documentation/devicetree/bindings/watchdog/cortina,gemini-watchdog.txt b/Documentation/devicetree/bindings/watchdog/cortina,gemini-watchdog.txt deleted file mode 100644 index bc4b865d178b..000000000000 --- a/Documentation/devicetree/bindings/watchdog/cortina,gemini-watchdog.txt +++ /dev/null @@ -1,17 +0,0 @@ -Cortina Systems Gemini SoC Watchdog - -Required properties: -- compatible : must be "cortina,gemini-watchdog" -- reg : shall contain base register location and length -- interrupts : shall contain the interrupt for the watchdog - -Optional properties: -- timeout-sec : the default watchdog timeout in seconds. - -Example: - -watchdog@41000000 { - compatible = "cortina,gemini-watchdog"; - reg = <0x41000000 0x1000>; - interrupts = <3 IRQ_TYPE_LEVEL_HIGH>; -}; diff --git a/Documentation/devicetree/bindings/watchdog/cortina,gemin-watchdog.txt b/Documentation/devicetree/bindings/watchdog/faraday,ftwdt010.txt similarity index 55% rename from Documentation/devicetree/bindings/watchdog/cortina,gemin-watchdog.txt rename to Documentation/devicetree/bindings/watchdog/faraday,ftwdt010.txt index bc4b865d178b..9ecdb502e605 100644 --- a/Documentation/devicetree/bindings/watchdog/cortina,gemin-watchdog.txt +++ b/Documentation/devicetree/bindings/watchdog/faraday,ftwdt010.txt @@ -1,7 +1,12 @@ -Cortina Systems Gemini SoC Watchdog +Faraday Technology FTWDT010 watchdog + +This is an IP part from Faraday Technology found in the Gemini +SoCs and others. Required properties: -- compatible : must be "cortina,gemini-watchdog" +- compatible : must be one of + "faraday,ftwdt010" + "cortina,gemini-watchdog", "faraday,ftwdt010" - reg : shall contain base register location and length - interrupts : shall contain the interrupt for the watchdog @@ -11,7 +16,7 @@ Optional properties: Example: watchdog@41000000 { - compatible = "cortina,gemini-watchdog"; + compatible = "faraday,ftwdt010"; reg = <0x41000000 0x1000>; interrupts = <3 IRQ_TYPE_LEVEL_HIGH>; }; From patchwork Sat Aug 12 18:43:09 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Linus Walleij X-Patchwork-Id: 109932 Delivered-To: patch@linaro.org Received: by 10.140.95.78 with SMTP id h72csp2442280qge; Sat, 12 Aug 2017 11:43:34 -0700 (PDT) X-Received: by 10.84.238.2 with SMTP id u2mr21963711plk.169.1502563414833; Sat, 12 Aug 2017 11:43:34 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1502563414; cv=none; d=google.com; s=arc-20160816; b=0pLkL+qZ8MwauaDNJKFdr1ci5OCWotkN0C5ahn305eIGjJTSqRvTzBf2DpE+GtxM5I 6L+NYmWpapaorxxvI49KKytF8wUSdajbMyBK5e0RfvQhlf0r+MDfWS0XtAYfnstmow/3 63P0fJnOYhNFgMkhy7mgYvdtnIIIXPolfZRt2XlJuhqT9cX90jg4ap/kfnh2wtgkPxkf Vum8E6Vhp51qN0YhNbaRHuoEk71QdL2iNii4q4Wg4jWayumsEZNdbik54q6WpgxSSMWZ CSpv1mlNXlPXnnfViLQU8TnkWoN7a82FOEEIdwxettWOcxloDJtYuf9K3ClFfUIDcGuF krSw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:references:in-reply-to:message-id:date :subject:cc:to:from:dkim-signature:arc-authentication-results; bh=nwwdJkCn747INgfxlvUgQCCdU6IGLsQL93qoRqd/7ks=; b=gknUpDaa8r10ostN69beV5b6BgBuBcvx5FKfxPXh7JvtrSjUIzCyKrMoPUaizq/nQY E+0pMvOMvP37HPE3UB4UtcCq0VWhFM+1WjJrqVNKNG1BfAhh4+iKt4as0jhoUB8v046t C30elUDPBENs/ifxVKGwt5SuOYfpQsjeEB9FLEPXD30xZfHJVRoKVds+ob0h35/QY9FX A3/fnmlMIb/E1U5Nz/q2dytj6n5MoKHmNpoU6D7s8NN6kJhmBg03HyBQol0SYgfYyuRw Ton9IGF4z7eJKd012QqecZ4W2E1gpmWF/8WAsSpUMzBSfyVXkV/zLOkIL3f/1MBRogQO dYuA== ARC-Authentication-Results: i=1; mx.google.com; dkim=neutral (body hash did not verify) header.i=@linaro.org header.s=google header.b=fPswoPOC; spf=pass (google.com: best guess record for domain of linux-watchdog-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-watchdog-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id p24si2288117pli.501.2017.08.12.11.43.34 for ; Sat, 12 Aug 2017 11:43:34 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-watchdog-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=neutral (body hash did not verify) header.i=@linaro.org header.s=google header.b=fPswoPOC; spf=pass (google.com: best guess record for domain of linux-watchdog-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-watchdog-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751155AbdHLSne (ORCPT ); Sat, 12 Aug 2017 14:43:34 -0400 Received: from mail-lf0-f42.google.com ([209.85.215.42]:38900 "EHLO mail-lf0-f42.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750995AbdHLSnd (ORCPT ); Sat, 12 Aug 2017 14:43:33 -0400 Received: by mail-lf0-f42.google.com with SMTP id y15so26870518lfd.5 for ; Sat, 12 Aug 2017 11:43:33 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=CwmHrKoEfcmDP0mDGuQx6mkRmk0bbc8S1Ae1r9/YTxw=; b=fPswoPOC9ZWeeGcZNxlz/1QfWqzXHZm1UmGNO2FTJwNrkz+S+uUJfA+0UGInQQejVy VZcbBociYB2gr2/gvjdNP6PPL2GkBh+HdWoF10U45gSa+4+dKqWFH4pWA9kPBuOEQjZQ 0B0wWWn3OecxovPPjzb7qk+emaDLexIQOq6RA= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=CwmHrKoEfcmDP0mDGuQx6mkRmk0bbc8S1Ae1r9/YTxw=; b=gi543BJJRVKuo8yU4vduSRLU2Km9p++i7NmcHRuunhRUN2QKMH0KLO4K6Mblp9X7eM 5eS7maDZksuj4qj5RNibF0A/gF8MXWLSDWy6fRmpJiwzKlaYa28Zw1zy8DpHFuE01arl ZB6iUUCboBGzOejrcG/XpjK+/M0vtAybq/p0sR7qfWJqyqBryxNn1uWbOPmVBs+b8nGq HXilMcPBlXffWlozMq6OIRSkbKeuCjAOlfMKmeeJCFGFyjfDHafnSVJhdrsXu6NNq01+ a6Lw/ljS8Bxacau1gVfk+uzM93cHhp3kPgjcPPfIv4Y3c/VWqM6eRp+xqEOAxd+1FgMm D5MA== X-Gm-Message-State: AHYfb5j5gLubnu4GfLbiBFaBA5eaSrEVMPixOgx9Pnz6EKYW9GTpMgzL OjJxKeuumQLMc6bW X-Received: by 10.25.19.207 with SMTP id 76mr6029764lft.193.1502563412232; Sat, 12 Aug 2017 11:43:32 -0700 (PDT) Received: from fabina.bredbandsbolaget.se (c-277e71d5.014-348-6c756e10.cust.bredbandsbolaget.se. [213.113.126.39]) by smtp.gmail.com with ESMTPSA id d64sm696628lfg.22.2017.08.12.11.43.30 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Sat, 12 Aug 2017 11:43:31 -0700 (PDT) From: Linus Walleij To: Wim Van Sebroeck , Guenter Roeck , Jonas Jensen , Andrew Jeffery , Joel Stanley Cc: linux-arm-kernel@lists.infradead.org, linux-watchdog@vger.kernel.org, Linus Walleij Subject: [PATCH 02/11] watchdog: gemini/ftwdt010: rename driver and symbols Date: Sat, 12 Aug 2017 20:43:09 +0200 Message-Id: <20170812184318.10144-3-linus.walleij@linaro.org> X-Mailer: git-send-email 2.13.4 In-Reply-To: <20170812184318.10144-1-linus.walleij@linaro.org> References: <20170812184318.10144-1-linus.walleij@linaro.org> Sender: linux-watchdog-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-watchdog@vger.kernel.org This renames all the driver files and symbols for the Gemini watchdog to FTWDT010 as it has been revealed that this IP block is a generic watchdog timer from Faraday Technology used in several SoC designs. Select thid driver by default for the Gemini, it is a sensible driver to always have enabled. Signed-off-by: Linus Walleij --- drivers/watchdog/Kconfig | 14 +-- drivers/watchdog/Makefile | 2 +- drivers/watchdog/{gemini_wdt.c => ftwdt010_wdt.c} | 117 +++++++++++----------- 3 files changed, 68 insertions(+), 65 deletions(-) rename drivers/watchdog/{gemini_wdt.c => ftwdt010_wdt.c} (50%) -- 2.13.4 -- To unsubscribe from this list: send the line "unsubscribe linux-watchdog" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html diff --git a/drivers/watchdog/Kconfig b/drivers/watchdog/Kconfig index c722cbfdc7e6..fd44a542036a 100644 --- a/drivers/watchdog/Kconfig +++ b/drivers/watchdog/Kconfig @@ -321,16 +321,18 @@ config 977_WATCHDOG Not sure? It's safe to say N. -config GEMINI_WATCHDOG - tristate "Gemini watchdog" - depends on ARCH_GEMINI +config FTWDT010_WATCHDOG + tristate "Faraday Technology FTWDT010 watchdog" + depends on ARM || COMPILE_TEST select WATCHDOG_CORE + default ARCH_GEMINI help - Say Y here if to include support for the watchdog timer - embedded in the Cortina Systems Gemini family of devices. + Say Y here if to include support for the Faraday Technology + FTWDT010 watchdog timer embedded in the Cortina Systems Gemini + family of devices. To compile this driver as a module, choose M here: the - module will be called gemini_wdt. + module will be called ftwdt010_wdt. config IXP4XX_WATCHDOG tristate "IXP4xx Watchdog" diff --git a/drivers/watchdog/Makefile b/drivers/watchdog/Makefile index 56adf9fa67d0..df91d7db821c 100644 --- a/drivers/watchdog/Makefile +++ b/drivers/watchdog/Makefile @@ -45,7 +45,7 @@ obj-$(CONFIG_OMAP_WATCHDOG) += omap_wdt.o obj-$(CONFIG_TWL4030_WATCHDOG) += twl4030_wdt.o obj-$(CONFIG_21285_WATCHDOG) += wdt285.o obj-$(CONFIG_977_WATCHDOG) += wdt977.o -obj-$(CONFIG_GEMINI_WATCHDOG) += gemini_wdt.o +obj-$(CONFIG_FTWDT010_WATCHDOG) += ftwdt010_wdt.o obj-$(CONFIG_IXP4XX_WATCHDOG) += ixp4xx_wdt.o obj-$(CONFIG_KS8695_WATCHDOG) += ks8695_wdt.o obj-$(CONFIG_S3C2410_WATCHDOG) += s3c2410_wdt.o diff --git a/drivers/watchdog/gemini_wdt.c b/drivers/watchdog/ftwdt010_wdt.c similarity index 50% rename from drivers/watchdog/gemini_wdt.c rename to drivers/watchdog/ftwdt010_wdt.c index 8155aa619e4c..637ffd812f0b 100644 --- a/drivers/watchdog/gemini_wdt.c +++ b/drivers/watchdog/ftwdt010_wdt.c @@ -1,5 +1,5 @@ /* - * Watchdog driver for Cortina Systems Gemini SoC + * Watchdog driver for Faraday Technology FTWDT010 * * Copyright (C) 2017 Linus Walleij * @@ -22,10 +22,10 @@ #include #include -#define GEMINI_WDCOUNTER 0x0 -#define GEMINI_WDLOAD 0x4 -#define GEMINI_WDRESTART 0x8 -#define GEMINI_WDCR 0xC +#define FTWDT010_WDCOUNTER 0x0 +#define FTWDT010_WDLOAD 0x4 +#define FTWDT010_WDRESTART 0x8 +#define FTWDT010_WDCR 0xC #define WDRESTART_MAGIC 0x5AB9 @@ -35,79 +35,79 @@ #define WDT_CLOCK 5000000 /* 5 MHz */ -struct gemini_wdt { +struct ftwdt010_wdt { struct watchdog_device wdd; struct device *dev; void __iomem *base; }; static inline -struct gemini_wdt *to_gemini_wdt(struct watchdog_device *wdd) +struct ftwdt010_wdt *to_ftwdt010_wdt(struct watchdog_device *wdd) { - return container_of(wdd, struct gemini_wdt, wdd); + return container_of(wdd, struct ftwdt010_wdt, wdd); } -static int gemini_wdt_start(struct watchdog_device *wdd) +static int ftwdt010_wdt_start(struct watchdog_device *wdd) { - struct gemini_wdt *gwdt = to_gemini_wdt(wdd); + struct ftwdt010_wdt *gwdt = to_ftwdt010_wdt(wdd); - writel(wdd->timeout * WDT_CLOCK, gwdt->base + GEMINI_WDLOAD); - writel(WDRESTART_MAGIC, gwdt->base + GEMINI_WDRESTART); + writel(wdd->timeout * WDT_CLOCK, gwdt->base + FTWDT010_WDLOAD); + writel(WDRESTART_MAGIC, gwdt->base + FTWDT010_WDRESTART); /* set clock before enabling */ writel(WDCR_CLOCK_5MHZ | WDCR_SYS_RST, - gwdt->base + GEMINI_WDCR); + gwdt->base + FTWDT010_WDCR); writel(WDCR_CLOCK_5MHZ | WDCR_SYS_RST | WDCR_ENABLE, - gwdt->base + GEMINI_WDCR); + gwdt->base + FTWDT010_WDCR); return 0; } -static int gemini_wdt_stop(struct watchdog_device *wdd) +static int ftwdt010_wdt_stop(struct watchdog_device *wdd) { - struct gemini_wdt *gwdt = to_gemini_wdt(wdd); + struct ftwdt010_wdt *gwdt = to_ftwdt010_wdt(wdd); - writel(0, gwdt->base + GEMINI_WDCR); + writel(0, gwdt->base + FTWDT010_WDCR); return 0; } -static int gemini_wdt_ping(struct watchdog_device *wdd) +static int ftwdt010_wdt_ping(struct watchdog_device *wdd) { - struct gemini_wdt *gwdt = to_gemini_wdt(wdd); + struct ftwdt010_wdt *gwdt = to_ftwdt010_wdt(wdd); - writel(WDRESTART_MAGIC, gwdt->base + GEMINI_WDRESTART); + writel(WDRESTART_MAGIC, gwdt->base + FTWDT010_WDRESTART); return 0; } -static int gemini_wdt_set_timeout(struct watchdog_device *wdd, +static int ftwdt010_wdt_set_timeout(struct watchdog_device *wdd, unsigned int timeout) { wdd->timeout = timeout; if (watchdog_active(wdd)) - gemini_wdt_start(wdd); + ftwdt010_wdt_start(wdd); return 0; } -static irqreturn_t gemini_wdt_interrupt(int irq, void *data) +static irqreturn_t ftwdt010_wdt_interrupt(int irq, void *data) { - struct gemini_wdt *gwdt = data; + struct ftwdt010_wdt *gwdt = data; watchdog_notify_pretimeout(&gwdt->wdd); return IRQ_HANDLED; } -static const struct watchdog_ops gemini_wdt_ops = { - .start = gemini_wdt_start, - .stop = gemini_wdt_stop, - .ping = gemini_wdt_ping, - .set_timeout = gemini_wdt_set_timeout, +static const struct watchdog_ops ftwdt010_wdt_ops = { + .start = ftwdt010_wdt_start, + .stop = ftwdt010_wdt_stop, + .ping = ftwdt010_wdt_ping, + .set_timeout = ftwdt010_wdt_set_timeout, .owner = THIS_MODULE, }; -static const struct watchdog_info gemini_wdt_info = { +static const struct watchdog_info ftwdt010_wdt_info = { .options = WDIOF_KEEPALIVEPING | WDIOF_MAGICCLOSE | WDIOF_SETTIMEOUT, @@ -115,11 +115,11 @@ static const struct watchdog_info gemini_wdt_info = { }; -static int gemini_wdt_probe(struct platform_device *pdev) +static int ftwdt010_wdt_probe(struct platform_device *pdev) { struct device *dev = &pdev->dev; struct resource *res; - struct gemini_wdt *gwdt; + struct ftwdt010_wdt *gwdt; unsigned int reg; int irq; int ret; @@ -138,8 +138,8 @@ static int gemini_wdt_probe(struct platform_device *pdev) return -EINVAL; gwdt->dev = dev; - gwdt->wdd.info = &gemini_wdt_info; - gwdt->wdd.ops = &gemini_wdt_ops; + gwdt->wdd.info = &ftwdt010_wdt_info; + gwdt->wdd.ops = &ftwdt010_wdt_ops; gwdt->wdd.min_timeout = 1; gwdt->wdd.max_timeout = 0xFFFFFFFF / WDT_CLOCK; gwdt->wdd.parent = dev; @@ -151,14 +151,14 @@ static int gemini_wdt_probe(struct platform_device *pdev) gwdt->wdd.timeout = 13U; watchdog_init_timeout(&gwdt->wdd, 0, dev); - reg = readw(gwdt->base + GEMINI_WDCR); + reg = readw(gwdt->base + FTWDT010_WDCR); if (reg & WDCR_ENABLE) { /* Watchdog was enabled by the bootloader, disable it. */ reg &= ~WDCR_ENABLE; - writel(reg, gwdt->base + GEMINI_WDCR); + writel(reg, gwdt->base + FTWDT010_WDCR); } - ret = devm_request_irq(dev, irq, gemini_wdt_interrupt, 0, + ret = devm_request_irq(dev, irq, ftwdt010_wdt_interrupt, 0, "watchdog bark", gwdt); if (ret) return ret; @@ -171,59 +171,60 @@ static int gemini_wdt_probe(struct platform_device *pdev) /* Set up platform driver data */ platform_set_drvdata(pdev, gwdt); - dev_info(dev, "Gemini watchdog driver enabled\n"); + dev_info(dev, "FTWDT010 watchdog driver enabled\n"); return 0; } -static int __maybe_unused gemini_wdt_suspend(struct device *dev) +static int __maybe_unused ftwdt010_wdt_suspend(struct device *dev) { - struct gemini_wdt *gwdt = dev_get_drvdata(dev); + struct ftwdt010_wdt *gwdt = dev_get_drvdata(dev); unsigned int reg; - reg = readw(gwdt->base + GEMINI_WDCR); + reg = readw(gwdt->base + FTWDT010_WDCR); reg &= ~WDCR_ENABLE; - writel(reg, gwdt->base + GEMINI_WDCR); + writel(reg, gwdt->base + FTWDT010_WDCR); return 0; } -static int __maybe_unused gemini_wdt_resume(struct device *dev) +static int __maybe_unused ftwdt010_wdt_resume(struct device *dev) { - struct gemini_wdt *gwdt = dev_get_drvdata(dev); + struct ftwdt010_wdt *gwdt = dev_get_drvdata(dev); unsigned int reg; if (watchdog_active(&gwdt->wdd)) { - reg = readw(gwdt->base + GEMINI_WDCR); + reg = readw(gwdt->base + FTWDT010_WDCR); reg |= WDCR_ENABLE; - writel(reg, gwdt->base + GEMINI_WDCR); + writel(reg, gwdt->base + FTWDT010_WDCR); } return 0; } -static const struct dev_pm_ops gemini_wdt_dev_pm_ops = { - SET_SYSTEM_SLEEP_PM_OPS(gemini_wdt_suspend, - gemini_wdt_resume) +static const struct dev_pm_ops ftwdt010_wdt_dev_pm_ops = { + SET_SYSTEM_SLEEP_PM_OPS(ftwdt010_wdt_suspend, + ftwdt010_wdt_resume) }; #ifdef CONFIG_OF -static const struct of_device_id gemini_wdt_match[] = { +static const struct of_device_id ftwdt010_wdt_match[] = { + { .compatible = "faraday,ftwdt010" }, { .compatible = "cortina,gemini-watchdog" }, {}, }; -MODULE_DEVICE_TABLE(of, gemini_wdt_match); +MODULE_DEVICE_TABLE(of, ftwdt010_wdt_match); #endif -static struct platform_driver gemini_wdt_driver = { - .probe = gemini_wdt_probe, +static struct platform_driver ftwdt010_wdt_driver = { + .probe = ftwdt010_wdt_probe, .driver = { - .name = "gemini-wdt", - .of_match_table = of_match_ptr(gemini_wdt_match), - .pm = &gemini_wdt_dev_pm_ops, + .name = "ftwdt010-wdt", + .of_match_table = of_match_ptr(ftwdt010_wdt_match), + .pm = &ftwdt010_wdt_dev_pm_ops, }, }; -module_platform_driver(gemini_wdt_driver); +module_platform_driver(ftwdt010_wdt_driver); MODULE_AUTHOR("Linus Walleij"); -MODULE_DESCRIPTION("Watchdog driver for Gemini"); +MODULE_DESCRIPTION("Watchdog driver for Faraday Technology FTWDT010"); MODULE_LICENSE("GPL"); From patchwork Sat Aug 12 18:43:10 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Linus Walleij X-Patchwork-Id: 109933 Delivered-To: patch@linaro.org Received: by 10.140.95.78 with SMTP id h72csp2442311qge; Sat, 12 Aug 2017 11:43:36 -0700 (PDT) X-Received: by 10.84.217.140 with SMTP id p12mr21877281pli.323.1502563416848; Sat, 12 Aug 2017 11:43:36 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1502563416; cv=none; d=google.com; s=arc-20160816; b=YJmyJy+YH5avZi+TUuwPT8i1uDMOW8ahhTg50WEMhrllo4OwkYrWoW80Be2B0jrKBA HhAjO9mUeFygtF4mx/ZSNu+UCBruBUsQkW4pq3LxR/7bYCqzbXuXBCrAZGmrUA1p0N5e nuBSw747XrhHenEUHGbxuoucA90njnshd39Tj1/x0ilhFlunF+Norsk8sv8HK8I0ejRN 3E/j5s43CibBfYfqj3S2OKbgrmqHiothlgBhPhIeSPaHiLkiLhj/R2YpWD59ENBiz96U fYFs1GLVuDgciH5Qvdf1sTlzEcwG/Vt7At/1IEbgBkaoBBhbeABGYpGkpHUazrqjWoJ/ YoSg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:references:in-reply-to:message-id:date :subject:cc:to:from:dkim-signature:arc-authentication-results; bh=OqBuA79OGDHsLFL10hlkK7nmkHDcLeVu9Q10vemjDyY=; b=yDWiBw6esskkdmIppxb6v/dwzgdJTy5cPjdP/ncg/jvrWzAMq6rPXOQjvTxGPt/E65 V/kdBohpKo2Rq5KXDovl1VnY4apFajuaMkadajq4ojdOCwKbX+ZijmlewG0hA3+dGgno Z6ipWITH2evWh4233MGbZaaOTnzzW37v0Ro8vKd7t13cC33oeMVaYjUGThWsZiE9pKx/ UdxA36Jco7WeNO5WYr2ci4tX/cGU1Adrz/0hGVjup5Hjf+ZrpTHcNTi0KXzNrCmPXbKs nOGcrv6tmSkx+KpX9+M38jmL46Jl3B0g4Cyvr9qU4FwM3ZscVP5PjX/EMY23H9J0fyJw z8hg== ARC-Authentication-Results: i=1; mx.google.com; dkim=neutral (body hash did not verify) header.i=@linaro.org header.s=google header.b=EdnP7BQk; spf=pass (google.com: best guess record for domain of linux-watchdog-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-watchdog-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id p24si2288117pli.501.2017.08.12.11.43.36 for ; Sat, 12 Aug 2017 11:43:36 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-watchdog-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=neutral (body hash did not verify) header.i=@linaro.org header.s=google header.b=EdnP7BQk; spf=pass (google.com: best guess record for domain of linux-watchdog-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-watchdog-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751205AbdHLSng (ORCPT ); Sat, 12 Aug 2017 14:43:36 -0400 Received: from mail-lf0-f46.google.com ([209.85.215.46]:34583 "EHLO mail-lf0-f46.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750995AbdHLSng (ORCPT ); Sat, 12 Aug 2017 14:43:36 -0400 Received: by mail-lf0-f46.google.com with SMTP id g25so26977876lfh.1 for ; Sat, 12 Aug 2017 11:43:35 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=32saFbnctjvgnyO+C9vwrZvRPUZjtWLdBAJMNudJpaM=; b=EdnP7BQkr5EgngpjJm6k24pUO+zp80Szs4H8bfzS0v5Rm3plrqmatIXCNxMbTN0aG4 ReqNG9EIThrksmCt5z7MC9To1nb4QPcGP6dAhIOPLXAKiTK99SBqUQSk8e+V3NrWzvE/ EIYPWJwlOtdLKSe25fevq+0Zbe0gYemWtDSpo= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=32saFbnctjvgnyO+C9vwrZvRPUZjtWLdBAJMNudJpaM=; b=QDI0qgKysTxQAWG6pcTp6V3ABnoRquO8VvuF4p9zB5AwUuM42271DnggIwzsAdJ8wi Opov+QyXcop/E3hv6UNGNfplZmpOmXF0UVkTkLimNWr2VN0dOd2rhbF7TEdAa3jfO+BS z4IYC+yGaVMtpnyFuc2DTZxG8ue72esoElEBdOPZ4Q9mpy0v2PqZIn+qlCOf7wqactQE DYLcKACbtyymvYPcq9/4TcFpUiTOSazahp/BeVdTSaL+L12nAg3ARblFFuvkvmptYl6N c8lb9Rgxt4o3a9vEhi91iQ456ydN+fBvX5+3vwaNjPpCbhVja0q3TVSxl1mg0jr9SJyd g/SQ== X-Gm-Message-State: AHYfb5hJQYn3RwPhEvJk+rbfs/U+emjcmOolXQ3adsHMDQaBq4tXU+4s UajdD0WFbzuI9EWA X-Received: by 10.25.43.72 with SMTP id r69mr7486914lfr.225.1502563414693; Sat, 12 Aug 2017 11:43:34 -0700 (PDT) Received: from fabina.bredbandsbolaget.se (c-277e71d5.014-348-6c756e10.cust.bredbandsbolaget.se. [213.113.126.39]) by smtp.gmail.com with ESMTPSA id d64sm696628lfg.22.2017.08.12.11.43.33 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Sat, 12 Aug 2017 11:43:33 -0700 (PDT) From: Linus Walleij To: Wim Van Sebroeck , Guenter Roeck , Jonas Jensen , Andrew Jeffery , Joel Stanley Cc: linux-arm-kernel@lists.infradead.org, linux-watchdog@vger.kernel.org, Linus Walleij Subject: [PATCH 03/11] watchdog: ftwdt010: Make interrupt optional Date: Sat, 12 Aug 2017 20:43:10 +0200 Message-Id: <20170812184318.10144-4-linus.walleij@linaro.org> X-Mailer: git-send-email 2.13.4 In-Reply-To: <20170812184318.10144-1-linus.walleij@linaro.org> References: <20170812184318.10144-1-linus.walleij@linaro.org> Sender: linux-watchdog-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-watchdog@vger.kernel.org The Moxart does not appear to be using the interrupt from the watchdog timer, maybe it's not even routed, so as to support more architectures with this driver, make the interrupt optional. While we are at it: actually enable the use of the interrupt if present by setting the right bit in the control register and define the missing control register bits. Signed-off-by: Linus Walleij --- drivers/watchdog/ftwdt010_wdt.c | 31 +++++++++++++++++++------------ 1 file changed, 19 insertions(+), 12 deletions(-) -- 2.13.4 -- To unsubscribe from this list: send the line "unsubscribe linux-watchdog" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html diff --git a/drivers/watchdog/ftwdt010_wdt.c b/drivers/watchdog/ftwdt010_wdt.c index 637ffd812f0b..ab38a3a89300 100644 --- a/drivers/watchdog/ftwdt010_wdt.c +++ b/drivers/watchdog/ftwdt010_wdt.c @@ -30,6 +30,8 @@ #define WDRESTART_MAGIC 0x5AB9 #define WDCR_CLOCK_5MHZ BIT(4) +#define WDCR_WDEXT BIT(3) +#define WDCR_WDINTR BIT(2) #define WDCR_SYS_RST BIT(1) #define WDCR_ENABLE BIT(0) @@ -39,6 +41,7 @@ struct ftwdt010_wdt { struct watchdog_device wdd; struct device *dev; void __iomem *base; + bool has_irq; }; static inline @@ -50,14 +53,18 @@ struct ftwdt010_wdt *to_ftwdt010_wdt(struct watchdog_device *wdd) static int ftwdt010_wdt_start(struct watchdog_device *wdd) { struct ftwdt010_wdt *gwdt = to_ftwdt010_wdt(wdd); + u32 enable; writel(wdd->timeout * WDT_CLOCK, gwdt->base + FTWDT010_WDLOAD); writel(WDRESTART_MAGIC, gwdt->base + FTWDT010_WDRESTART); /* set clock before enabling */ - writel(WDCR_CLOCK_5MHZ | WDCR_SYS_RST, - gwdt->base + FTWDT010_WDCR); - writel(WDCR_CLOCK_5MHZ | WDCR_SYS_RST | WDCR_ENABLE, - gwdt->base + FTWDT010_WDCR); + enable = WDCR_CLOCK_5MHZ | WDCR_SYS_RST; + writel(enable, gwdt->base + FTWDT010_WDCR); + enable |= WDCR_CLOCK_5MHZ; + if (gwdt->has_irq) + enable |= WDCR_WDINTR; + enable |= WDCR_ENABLE; + writel(enable, gwdt->base + FTWDT010_WDCR); return 0; } @@ -133,10 +140,6 @@ static int ftwdt010_wdt_probe(struct platform_device *pdev) if (IS_ERR(gwdt->base)) return PTR_ERR(gwdt->base); - irq = platform_get_irq(pdev, 0); - if (!irq) - return -EINVAL; - gwdt->dev = dev; gwdt->wdd.info = &ftwdt010_wdt_info; gwdt->wdd.ops = &ftwdt010_wdt_ops; @@ -158,10 +161,14 @@ static int ftwdt010_wdt_probe(struct platform_device *pdev) writel(reg, gwdt->base + FTWDT010_WDCR); } - ret = devm_request_irq(dev, irq, ftwdt010_wdt_interrupt, 0, - "watchdog bark", gwdt); - if (ret) - return ret; + irq = platform_get_irq(pdev, 0); + if (irq) { + ret = devm_request_irq(dev, irq, ftwdt010_wdt_interrupt, 0, + "watchdog bark", gwdt); + if (ret) + return ret; + gwdt->has_irq = true; + } ret = devm_watchdog_register_device(dev, &gwdt->wdd); if (ret) { From patchwork Sat Aug 12 18:43:11 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Linus Walleij X-Patchwork-Id: 109934 Delivered-To: patch@linaro.org Received: by 10.140.95.78 with SMTP id h72csp2442348qge; Sat, 12 Aug 2017 11:43:39 -0700 (PDT) X-Received: by 10.98.13.219 with SMTP id 88mr20055596pfn.179.1502563419726; Sat, 12 Aug 2017 11:43:39 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1502563419; cv=none; d=google.com; s=arc-20160816; b=JeJJYRXrTm+1N1SDKYDTUqWfTQFcPLb/b5LzHYk7RfG7XsW9kpi11TXOEnFHJIX3Th D8xDonkF5WFM+ht99Z9IP5bti5BoPqJlbX5c70T1qGt9chGVpPz+XmrNJhgS0ORAmpeR HkW5X+RFulNP/H7ITOPVqj0W+ms+SGXWegbv++N2QgnAySx0xnLQNwtwtTqPqoUD+lmM cjiZ1u03sDsvr2G/CwMfgyRNm26pJmISD6mGT7zsZHK4b61DGhAwft9emXuNy526AmTc 4eXEJpMZEdLtJsOxhu5Dbo7pOAC+fsYB1F8LWuaLtegCLUKNkzYqnmHVKft45K8ZF/W2 xgYw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:references:in-reply-to:message-id:date :subject:cc:to:from:dkim-signature:arc-authentication-results; bh=9KEqeiN6ZrGZfPDrg3xc55eIt4cF+WYFJpULtT7gHGk=; b=t7f2Z4ubcIHWw8XB7zQLjKA+BnqpIJtUoZYKnKzn60R6Z2TQ50XBBIDJeJCVcfXUIh kiaAJ7Rd8OUogu/cM+7sh7CFHvNCieSyTmxn/K6jZmiSL315bL+0CVaMCs4I2uwjfcjw ++90bKAtBJBPTcK+tdes4G3jWJliqXjEi8zMTxOZndh5m4KXLOq5/b3DwxnrvT5VucPE MhDm8KUUWwprLzshIdsa1JI8rOU2f1Lrhu/hd+fm9W5dVujQOSfUAoSRlSlCWLobKM7D 36R6CYC2Ei3Oqozyn/PhnfGoesz9s/2hv2GgOaxUcblBaCllJtyHohMh8dBMTYQaLWdp xghg== ARC-Authentication-Results: i=1; mx.google.com; dkim=neutral (body hash did not verify) header.i=@linaro.org header.s=google header.b=B7RSB/cX; spf=pass (google.com: best guess record for domain of linux-watchdog-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-watchdog-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id p24si2288117pli.501.2017.08.12.11.43.39 for ; Sat, 12 Aug 2017 11:43:39 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-watchdog-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=neutral (body hash did not verify) header.i=@linaro.org header.s=google header.b=B7RSB/cX; spf=pass (google.com: best guess record for domain of linux-watchdog-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-watchdog-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751344AbdHLSnj (ORCPT ); Sat, 12 Aug 2017 14:43:39 -0400 Received: from mail-lf0-f54.google.com ([209.85.215.54]:34587 "EHLO mail-lf0-f54.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750995AbdHLSni (ORCPT ); Sat, 12 Aug 2017 14:43:38 -0400 Received: by mail-lf0-f54.google.com with SMTP id g25so26978055lfh.1 for ; Sat, 12 Aug 2017 11:43:38 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=W3JXIIpKRU38t5a5JOCOchksDI7Kkr1AWJZll+vqZok=; b=B7RSB/cXhNiv8tKG8ozgoB5Dxplv68/AQk/2TOOeC3d+VMgeNGcoAmw2lNgkAr3vOo weGsNQUPjIFWag2hS0qz6ZV54YcYhDjMEiEgFWjEfoqkCiHei+oCokW3ClxeOjRiZR3Q wdrvBuvTYbcmSqP0VNAZOr5TtkwMjlg1dgV1E= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=W3JXIIpKRU38t5a5JOCOchksDI7Kkr1AWJZll+vqZok=; b=st6CoM/+bTK/RX4gIOBp2qHx40c8LXkHkzG5MPSgOEs1VgIuoRv++6X6fsdBFIzzqP XF2iFULBqJd2wdvPv+Ht3+8/eQPlvYEIGCZq/m+ofovTc7yUPIIHR2eD/v7ip55NEYai YFk0HmvTwwZ+BMY95Jp05bz9PQ+NhTJdC8z7YRP4N3E904KHN4TVGP7SmQ8wH4mZ1NyV 8ZP2eIzwthOcM3Cp8plwn9S2fG7CiPXspF07wWel5RIxcP8n3OMiPmuNXbicjjkHQ1uB IjGLTZWMIo8Mh1b7Lu69rFr8pXwVr39+J3+kCbqmqXXMoxe1przdOMAbpsF+FMZTJHyU jLGw== X-Gm-Message-State: AHYfb5hbdeYLAnsIvdeB9yqVxr/XdnkW7AjoL6VsKy5C/vydEAiBoJ91 R+EPoslRjRqjW5np X-Received: by 10.25.87.208 with SMTP id l199mr6650533lfb.199.1502563417232; Sat, 12 Aug 2017 11:43:37 -0700 (PDT) Received: from fabina.bredbandsbolaget.se (c-277e71d5.014-348-6c756e10.cust.bredbandsbolaget.se. [213.113.126.39]) by smtp.gmail.com with ESMTPSA id d64sm696628lfg.22.2017.08.12.11.43.35 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Sat, 12 Aug 2017 11:43:36 -0700 (PDT) From: Linus Walleij To: Wim Van Sebroeck , Guenter Roeck , Jonas Jensen , Andrew Jeffery , Joel Stanley Cc: linux-arm-kernel@lists.infradead.org, linux-watchdog@vger.kernel.org, Linus Walleij Subject: [PATCH 04/11] watchdog: ftwdt010: Add clock support Date: Sat, 12 Aug 2017 20:43:11 +0200 Message-Id: <20170812184318.10144-5-linus.walleij@linaro.org> X-Mailer: git-send-email 2.13.4 In-Reply-To: <20170812184318.10144-1-linus.walleij@linaro.org> References: <20170812184318.10144-1-linus.walleij@linaro.org> Sender: linux-watchdog-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-watchdog@vger.kernel.org The Gemini platform now provides a proper clock look-up for this and other IPs, so add clock support to the driver. This also aids in using the same driver with other platforms such as MOXA ART. The IP has two clock inputs: PCLK (the IP peripheral clock) and EXTCLK (an external clock). We are a bit elaborate around this: on Gemini the EXTCLK is used by default today and it's 5MHz, and on MOXA ART the PCLK is used. On Aspeed the EXTCLK is used and it's 1MHz. So add some clever code to fall back to platform defaults if PCLK or EXTCLK is not provided by the device tree. Take this opportnity to implement .remove() for the driver that stops the watchdog and disables the clocks. Add credits that this code is inspired by MOXA ART. Signed-off-by: Linus Walleij --- drivers/watchdog/ftwdt010_wdt.c | 79 ++++++++++++++++++++++++++++++++++++----- 1 file changed, 71 insertions(+), 8 deletions(-) -- 2.13.4 -- To unsubscribe from this list: send the line "unsubscribe linux-watchdog" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html diff --git a/drivers/watchdog/ftwdt010_wdt.c b/drivers/watchdog/ftwdt010_wdt.c index ab38a3a89300..680279f5c679 100644 --- a/drivers/watchdog/ftwdt010_wdt.c +++ b/drivers/watchdog/ftwdt010_wdt.c @@ -5,6 +5,8 @@ * * Inspired by the out-of-tree drivers from OpenWRT: * Copyright (C) 2009 Paulius Zaleckas + * Inspired by the MOXA ART driver from Jonas Jensen: + * Copyright (C) 2013 Jonas Jensen * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License version 2 as @@ -18,9 +20,11 @@ #include #include #include +#include #include #include #include +#include #define FTWDT010_WDCOUNTER 0x0 #define FTWDT010_WDLOAD 0x4 @@ -29,19 +33,21 @@ #define WDRESTART_MAGIC 0x5AB9 -#define WDCR_CLOCK_5MHZ BIT(4) +#define WDCR_EXTCLK BIT(4) #define WDCR_WDEXT BIT(3) #define WDCR_WDINTR BIT(2) #define WDCR_SYS_RST BIT(1) #define WDCR_ENABLE BIT(0) -#define WDT_CLOCK 5000000 /* 5 MHz */ - struct ftwdt010_wdt { struct watchdog_device wdd; struct device *dev; void __iomem *base; bool has_irq; + struct clk *pclk; + struct clk *extclk; + unsigned int clk_freq; + bool use_extclk; }; static inline @@ -55,12 +61,13 @@ static int ftwdt010_wdt_start(struct watchdog_device *wdd) struct ftwdt010_wdt *gwdt = to_ftwdt010_wdt(wdd); u32 enable; - writel(wdd->timeout * WDT_CLOCK, gwdt->base + FTWDT010_WDLOAD); + writel(wdd->timeout * gwdt->clk_freq, gwdt->base + FTWDT010_WDLOAD); writel(WDRESTART_MAGIC, gwdt->base + FTWDT010_WDRESTART); /* set clock before enabling */ - enable = WDCR_CLOCK_5MHZ | WDCR_SYS_RST; + enable = WDCR_SYS_RST; + if (gwdt->use_extclk) + enable |= WDCR_EXTCLK; writel(enable, gwdt->base + FTWDT010_WDCR); - enable |= WDCR_CLOCK_5MHZ; if (gwdt->has_irq) enable |= WDCR_WDINTR; enable |= WDCR_ENABLE; @@ -125,6 +132,7 @@ static const struct watchdog_info ftwdt010_wdt_info = { static int ftwdt010_wdt_probe(struct platform_device *pdev) { struct device *dev = &pdev->dev; + struct device_node *np = dev->of_node; struct resource *res; struct ftwdt010_wdt *gwdt; unsigned int reg; @@ -140,11 +148,51 @@ static int ftwdt010_wdt_probe(struct platform_device *pdev) if (IS_ERR(gwdt->base)) return PTR_ERR(gwdt->base); + gwdt->use_extclk = of_property_read_bool(np, "faraday,use-extclk"); + + gwdt->pclk = devm_clk_get(dev, "PCLK"); + if (!IS_ERR(gwdt->pclk)) { + ret = clk_prepare_enable(gwdt->pclk); + if (ret) { + dev_err(&pdev->dev, "unable to enable PCLK\n"); + return ret; + } + if (!gwdt->use_extclk) + gwdt->clk_freq = clk_get_rate(gwdt->pclk); + } else { + dev_info(dev, "PCLK clock not found assume always-on\n"); + } + + gwdt->extclk = devm_clk_get(dev, "EXTCLK"); + if (!IS_ERR(gwdt->extclk)) { + /* Only enable and get frequency from EXTCLK if it's in use */ + if (gwdt->use_extclk) { + ret = clk_prepare_enable(gwdt->extclk); + if (ret) { + dev_err(&pdev->dev, + "unable to enable EXTCLK\n"); + return ret; + } + gwdt->clk_freq = clk_get_rate(gwdt->extclk); + } + } else { + if (of_device_is_compatible(np, "cortina,gemini-watchdog")) { + gwdt->clk_freq = 5000000; + gwdt->use_extclk = true; + dev_info(dev, "assume 5MHz EXTCLK on Gemini\n"); + } + } + + if (gwdt->clk_freq == 0) { + dev_err(dev, "no clocking available\n"); + return -EINVAL; + } + gwdt->dev = dev; gwdt->wdd.info = &ftwdt010_wdt_info; gwdt->wdd.ops = &ftwdt010_wdt_ops; gwdt->wdd.min_timeout = 1; - gwdt->wdd.max_timeout = 0xFFFFFFFF / WDT_CLOCK; + gwdt->wdd.max_timeout = UINT_MAX / gwdt->clk_freq; gwdt->wdd.parent = dev; /* @@ -178,7 +226,21 @@ static int ftwdt010_wdt_probe(struct platform_device *pdev) /* Set up platform driver data */ platform_set_drvdata(pdev, gwdt); - dev_info(dev, "FTWDT010 watchdog driver enabled\n"); + dev_info(dev, "FTWDT010 watchdog driver @%uHz\n", + gwdt->clk_freq); + + return 0; +} + +static int ftwdt010_wdt_remove(struct platform_device *pdev) +{ + struct ftwdt010_wdt *gwdt = platform_get_drvdata(pdev); + + writel(0, gwdt->base + FTWDT010_WDCR); + if (!IS_ERR(gwdt->pclk)) + clk_disable_unprepare(gwdt->pclk); + if (!IS_ERR(gwdt->extclk) && gwdt->use_extclk) + clk_disable_unprepare(gwdt->extclk); return 0; } @@ -225,6 +287,7 @@ MODULE_DEVICE_TABLE(of, ftwdt010_wdt_match); static struct platform_driver ftwdt010_wdt_driver = { .probe = ftwdt010_wdt_probe, + .remove = ftwdt010_wdt_remove, .driver = { .name = "ftwdt010-wdt", .of_match_table = of_match_ptr(ftwdt010_wdt_match), From patchwork Sat Aug 12 18:43:12 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Linus Walleij X-Patchwork-Id: 109935 Delivered-To: patch@linaro.org Received: by 10.140.95.78 with SMTP id h72csp2442383qge; Sat, 12 Aug 2017 11:43:41 -0700 (PDT) X-Received: by 10.84.137.169 with SMTP id 38mr21789325pln.331.1502563421865; Sat, 12 Aug 2017 11:43:41 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1502563421; cv=none; d=google.com; s=arc-20160816; b=B97xvpyoVNQD6MF2RIPXFbxZW2hUZ28RZVR/3l/x/H0rtRLuRRX7KNYZmbNkUeoDFG TC1xwV3c/00nCV/XFQzUCF+I2F2UCexVwwJ7JhCxn/Xsmc1Fmvtb2aFfTVd6qqZaG0QP bu4zpyKg+FKG4U6Yfk95rc6rDkkIzmSP40E3sxMJ5L/5CtzgePam4J6Uvd9mZx4LtDwo FGjobsf9vR+VbggT4GIa8n1PM7wHsYkTV81sIHMIQ502ewJv2AUXnADkRo37VP7oNSnV 5uCd2KEvCJSiLuuq/lEgF5EN+5OwsNzC34CnLM2v/mVGIsCJE+Fk0kbpjPvD03Q5wSyw +ZwA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:references:in-reply-to:message-id:date :subject:cc:to:from:dkim-signature:arc-authentication-results; bh=ymPLFK2hV8x1Mgxlt39vXhC6XC58bvKrYPsh6BWbnOE=; b=dfmjxi1K3kVSFzrWy7UiQ2HTSrm/uFIU6zKYRVzr4yiN/QQJ0E5iUgf/wlWTfp+x9c /tSkIJPu1aVdMTbwAPl0KF5Rsp8raOAMVes8aEs/QL+Kp14c8Qa174XBfvXaqVTvbqKH hs6SowSCE9aJ3wMGnOS0FvcZA+1HRcXoom2MPiLf/CHKIu9oLZl5gy9qxdEQevdFqS6a wo9NHFueFcXT62Z205HTigeGcAeYPq6V4ANt/qLyJFJGexXFoCi/HR9VuouMEjan5Q9h 9n2UpPqo2olHC529sKlGQ6Q3HI0aWm99znDnPMMJEBsImeRkpVw0kCdw5xrmwfktsEMv wokw== ARC-Authentication-Results: i=1; mx.google.com; dkim=neutral (body hash did not verify) header.i=@linaro.org header.s=google header.b=Ct+s7SK1; spf=pass (google.com: best guess record for domain of linux-watchdog-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-watchdog-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id p24si2288117pli.501.2017.08.12.11.43.41 for ; Sat, 12 Aug 2017 11:43:41 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-watchdog-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=neutral (body hash did not verify) header.i=@linaro.org header.s=google header.b=Ct+s7SK1; spf=pass (google.com: best guess record for domain of linux-watchdog-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-watchdog-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751480AbdHLSnl (ORCPT ); Sat, 12 Aug 2017 14:43:41 -0400 Received: from mail-lf0-f54.google.com ([209.85.215.54]:35181 "EHLO mail-lf0-f54.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750995AbdHLSnl (ORCPT ); Sat, 12 Aug 2017 14:43:41 -0400 Received: by mail-lf0-f54.google.com with SMTP id t128so27038907lff.2 for ; Sat, 12 Aug 2017 11:43:40 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=c0JDdooZT7fvyB4RoQlKZY+ReA+TUYDdoyeDE3pE5c8=; b=Ct+s7SK175ZbUWj4/SXqp9cmB8NNU3kMzPKUinNo34EE3FcpQTPrk7kOSQYg9ojA5C +PyaeyidaMjIInHlgJ1IryuWOXXYCwzm3BI4Kna+9s3xfQJexJAFp4Oehwz6NZvuuI7d ZXV7Tuclv+bs+taivpB9E9xc88359Y0Pyu6hM= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=c0JDdooZT7fvyB4RoQlKZY+ReA+TUYDdoyeDE3pE5c8=; b=M71+fIcoqQzUCBAiDH3KYQks7Y8fxIwVP6vSuiTH6xr5evpePM5PDvqpHzryzpLxZu an9QX2il3vUh2gYfd5EaC8F3RyJn4vSdJ7KVKlVEgRGziEKGi793qXQ0mSe5XeqNj2wx qrVUJWbKbrV5fkaXDBZjS3UWbNLQXNQsWOAlwOC1akVCP3XEzQAsmlFVdBBYKzKpoO4S HcJ8oCeyUW+YNnV8mJB1ivZBv1Ou4M+XRQupsxGuwMIlpqkpWfCJe0UIBnWhy06jRkp+ PrXJkBNKDQowLJUZBRFUu2POgmTbrroZE3IXXyoEkHp2xSfdI7xkWz3xH8v5EUcs3B5b qcSQ== X-Gm-Message-State: AHYfb5j+0STHg0aou3DdXvuuBGApUSDtt+UCnRDnccyQ/IoMnUpDlW9z gtFMk8pQRa5jAAdT X-Received: by 10.25.202.74 with SMTP id h10mr6858098lfj.85.1502563419759; Sat, 12 Aug 2017 11:43:39 -0700 (PDT) Received: from fabina.bredbandsbolaget.se (c-277e71d5.014-348-6c756e10.cust.bredbandsbolaget.se. [213.113.126.39]) by smtp.gmail.com with ESMTPSA id d64sm696628lfg.22.2017.08.12.11.43.38 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Sat, 12 Aug 2017 11:43:38 -0700 (PDT) From: Linus Walleij To: Wim Van Sebroeck , Guenter Roeck , Jonas Jensen , Andrew Jeffery , Joel Stanley Cc: linux-arm-kernel@lists.infradead.org, linux-watchdog@vger.kernel.org, Linus Walleij Subject: [PATCH 05/11] watchdog: ftwdt010: Add restart support Date: Sat, 12 Aug 2017 20:43:12 +0200 Message-Id: <20170812184318.10144-6-linus.walleij@linaro.org> X-Mailer: git-send-email 2.13.4 In-Reply-To: <20170812184318.10144-1-linus.walleij@linaro.org> References: <20170812184318.10144-1-linus.walleij@linaro.org> Sender: linux-watchdog-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-watchdog@vger.kernel.org This enables the Faraday FTWDT010 to restart the system, if need be. Set the restart priority for the watchdog to 128. Signed-off-by: Linus Walleij --- drivers/watchdog/ftwdt010_wdt.c | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) -- 2.13.4 -- To unsubscribe from this list: send the line "unsubscribe linux-watchdog" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html diff --git a/drivers/watchdog/ftwdt010_wdt.c b/drivers/watchdog/ftwdt010_wdt.c index 680279f5c679..7fc865eea28d 100644 --- a/drivers/watchdog/ftwdt010_wdt.c +++ b/drivers/watchdog/ftwdt010_wdt.c @@ -56,6 +56,22 @@ struct ftwdt010_wdt *to_ftwdt010_wdt(struct watchdog_device *wdd) return container_of(wdd, struct ftwdt010_wdt, wdd); } +static int ftwdt010_wdt_restart(struct watchdog_device *wdd, + unsigned long action, void *data) +{ + struct ftwdt010_wdt *gwdt = to_ftwdt010_wdt(wdd); + u32 enable; + + writel(1, gwdt->base + FTWDT010_WDLOAD); + writel(WDRESTART_MAGIC, gwdt->base + FTWDT010_WDRESTART); + enable = WDCR_SYS_RST | WDCR_ENABLE; + if (gwdt->use_extclk) + enable |= WDCR_EXTCLK; + writel(enable, gwdt->base + FTWDT010_WDCR); + + return 0; +} + static int ftwdt010_wdt_start(struct watchdog_device *wdd) { struct ftwdt010_wdt *gwdt = to_ftwdt010_wdt(wdd); @@ -118,6 +134,7 @@ static const struct watchdog_ops ftwdt010_wdt_ops = { .stop = ftwdt010_wdt_stop, .ping = ftwdt010_wdt_ping, .set_timeout = ftwdt010_wdt_set_timeout, + .restart = ftwdt010_wdt_restart, .owner = THIS_MODULE, }; @@ -201,6 +218,7 @@ static int ftwdt010_wdt_probe(struct platform_device *pdev) */ gwdt->wdd.timeout = 13U; watchdog_init_timeout(&gwdt->wdd, 0, dev); + watchdog_set_restart_priority(&gwdt->wdd, 128); reg = readw(gwdt->base + FTWDT010_WDCR); if (reg & WDCR_ENABLE) { From patchwork Sat Aug 12 18:43:13 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Linus Walleij X-Patchwork-Id: 109936 Delivered-To: patch@linaro.org Received: by 10.140.95.78 with SMTP id h72csp2442416qge; Sat, 12 Aug 2017 11:43:44 -0700 (PDT) X-Received: by 10.84.178.129 with SMTP id z1mr22226071plb.260.1502563424462; Sat, 12 Aug 2017 11:43:44 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1502563424; cv=none; d=google.com; s=arc-20160816; b=nMFJ0XHRTXDzBnyWaEHgHWhcHtn5ym/R5NQCfl6nn5P6SyXUSjOInwjA6cuOtTShKn VSI9TV10brlgLxqO+tppTwfMLkX08WIv/Dt00Q0gNge1XbV5L1oOfQ24n0fbmpffVRQy CoYMB2VycFY2eGJFY44+m6LueaoNSrxWvAIdry7NjbSoyBWYNpJPjo/AbuTPwpogCsN9 u6lQOIKZHLl/UqtPLQdm9MdpJ50BgGqJDU04OztyvIC5CYKLfTGjiUiu9P3tSObe+xRp py//0Zw2MR2bMB6pCMXTiuVa50anhI5vdD/xIA8BhzEgK1xUCAHZVYGcc+wBI+S+qQYv +zmQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:references:in-reply-to:message-id:date :subject:cc:to:from:dkim-signature:arc-authentication-results; bh=6g4EivoVueka7ZB19d9s4uMmgT8FxSyvLNdlXYtiQzM=; b=FJBWoSktEOg2rytEwW1zYLY9Zn+RozbKTmCLCzd+NpIPKwdyad9w0+BKttqFRVUvNG TjICLdm6tw9R1zlIb4VPmXwbX1xPl+14L7Hb/T5rsdchsjl18lJ/4FwHNbdTbSC/NXjK YFwdkC6kPwM/6oLJrTZI2xof1rQHzrD2HmenMsAvLBr08Bh4Eo+MHN/A55Nzo4hf2Jlv +52sty2z8QZzXdb4fiyrTMU5sR53+ztQUpttusOGe7/Xh+1kePPwg7bUIaYLHroqi4BF cq+5qCb9/ZsLD4Ux1/XrC4X9OH5tKdks88Ryp7QUEESIoGbFMkvhEh1qKH48N+hgDMpx sd7Q== ARC-Authentication-Results: i=1; mx.google.com; dkim=neutral (body hash did not verify) header.i=@linaro.org header.s=google header.b=AHlKy4nR; spf=pass (google.com: best guess record for domain of linux-watchdog-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-watchdog-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id p24si2288117pli.501.2017.08.12.11.43.44 for ; Sat, 12 Aug 2017 11:43:44 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-watchdog-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=neutral (body hash did not verify) header.i=@linaro.org header.s=google header.b=AHlKy4nR; spf=pass (google.com: best guess record for domain of linux-watchdog-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-watchdog-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751494AbdHLSno (ORCPT ); Sat, 12 Aug 2017 14:43:44 -0400 Received: from mail-lf0-f53.google.com ([209.85.215.53]:36904 "EHLO mail-lf0-f53.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750995AbdHLSnn (ORCPT ); Sat, 12 Aug 2017 14:43:43 -0400 Received: by mail-lf0-f53.google.com with SMTP id m86so26897191lfi.4 for ; Sat, 12 Aug 2017 11:43:42 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=59TcH5+qhzs71hKwpxpyfO8WI8wrC5CMSfUkKfG37TQ=; b=AHlKy4nRfepNlersehjFKdyMG8WfMOtX02MWZ5TyDx8SIYGbi9/JeYmdOySek4B1kb ysWQCokyLBfoXQre7/ilrP4/EEHNAexR2P2UMU+w/yPUl3siWkMPXO3ld7RGBPHukE1m v0eXIbJECz5Oeci3ZAZBL7tX0OxmX15L2zYMg= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=59TcH5+qhzs71hKwpxpyfO8WI8wrC5CMSfUkKfG37TQ=; b=V83GYhAWFePVDcjos3cGFi2YWYSKJH3NAWebTlIDNFK18jOp4NmyYPna6UhQ5+NuCa TdXnBM2YuL7E93STfkWZ5VFJXBHh6WOsVzDlfn/fQFTfsJuGZ4D2RKrgcuhiIK9JOW8x P63BOXAQzOC/u9fZSMy0g2YTGKDpfhh6q2VQV329fHbtqrmypJrV0liOs9oqJCbhvs6S FPjTfbxDMhrlbH3WuwEgy5YybirlVZ2NgvH4Pr6zU18vXNzqvX9RkOZ/z0A9wa8h+44u EngfiMHrIQ3wGg6OSMP76TQd/JYtIbGAdIXoK7fEDn5jCmjTlvHc72XW0Zhv1+NY6ouT W+aw== X-Gm-Message-State: AHYfb5jSw9xJdkwZD+oLBthWQHKOQd0JmF0shjZ2+ekj925p+2KRgBIv Z7BaWgPhgOoU5fUl X-Received: by 10.25.203.8 with SMTP id b8mr6879273lfg.212.1502563422074; Sat, 12 Aug 2017 11:43:42 -0700 (PDT) Received: from fabina.bredbandsbolaget.se (c-277e71d5.014-348-6c756e10.cust.bredbandsbolaget.se. [213.113.126.39]) by smtp.gmail.com with ESMTPSA id d64sm696628lfg.22.2017.08.12.11.43.40 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Sat, 12 Aug 2017 11:43:41 -0700 (PDT) From: Linus Walleij To: Wim Van Sebroeck , Guenter Roeck , Jonas Jensen , Andrew Jeffery , Joel Stanley Cc: linux-arm-kernel@lists.infradead.org, linux-watchdog@vger.kernel.org, Linus Walleij , devicetree@vger.kernel.org Subject: [PATCH 06/11] watchdog: ftwdt010: Extend DT bindings to derivatives Date: Sat, 12 Aug 2017 20:43:13 +0200 Message-Id: <20170812184318.10144-7-linus.walleij@linaro.org> X-Mailer: git-send-email 2.13.4 In-Reply-To: <20170812184318.10144-1-linus.walleij@linaro.org> References: <20170812184318.10144-1-linus.walleij@linaro.org> Sender: linux-watchdog-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-watchdog@vger.kernel.org This extends the device tree bindings for the Faraday FTWDT010 block to cover: - The "moxa,moxart-watchdog" compatible version - The "aspeed,ast2400-wdt" and "aspeed,ast2500-wdt" versions - clocks (PCLK non-optional, the Gemini also have this now) - reset line (optional, exist on the Gemini) - configuration to use the external clock (faraday,use-extclk) Cc: devicetree@vger.kernel.org Signed-off-by: Linus Walleij --- .../devicetree/bindings/watchdog/faraday,ftwdt010.txt | 16 ++++++++++++++-- 1 file changed, 14 insertions(+), 2 deletions(-) -- 2.13.4 -- To unsubscribe from this list: send the line "unsubscribe linux-watchdog" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Acked-by: Rob Herring diff --git a/Documentation/devicetree/bindings/watchdog/faraday,ftwdt010.txt b/Documentation/devicetree/bindings/watchdog/faraday,ftwdt010.txt index 9ecdb502e605..016e353bb069 100644 --- a/Documentation/devicetree/bindings/watchdog/faraday,ftwdt010.txt +++ b/Documentation/devicetree/bindings/watchdog/faraday,ftwdt010.txt @@ -1,17 +1,27 @@ Faraday Technology FTWDT010 watchdog This is an IP part from Faraday Technology found in the Gemini -SoCs and others. +and MOXA ART SoCs and others. Required properties: - compatible : must be one of "faraday,ftwdt010" "cortina,gemini-watchdog", "faraday,ftwdt010" + "moxa,moxart-watchdog", "faraday,ftwdt010" + "aspeed,ast2400-wdt", "faraday,ftwdt010" + "aspeed,ast2500-wdt", "faraday,ftwdt010" - reg : shall contain base register location and length -- interrupts : shall contain the interrupt for the watchdog +- clocks : the clock driving the IP block (PCLK) and optionally + an external clock (EXTCLK) +- clock-names : should be "PCLK" for the IP block clock and + "EXTCLK" for the external clock if present Optional properties: +- interrupts : the bark interrupt for the watchdog +- resets : reset line for the IP block - timeout-sec : the default watchdog timeout in seconds. +- faraday,use-extclk : if set, the "EXTCLK" provided in the clocks + property will be used to clock the watchdog Example: @@ -19,4 +29,6 @@ watchdog@41000000 { compatible = "faraday,ftwdt010"; reg = <0x41000000 0x1000>; interrupts = <3 IRQ_TYPE_LEVEL_HIGH>; + clocks = <&pclk>; + clock-names = "PCLK"; }; From patchwork Sat Aug 12 18:43:14 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Linus Walleij X-Patchwork-Id: 109937 Delivered-To: patch@linaro.org Received: by 10.140.95.78 with SMTP id h72csp2442452qge; Sat, 12 Aug 2017 11:43:47 -0700 (PDT) X-Received: by 10.84.194.195 with SMTP id h61mr22728525pld.140.1502563427049; Sat, 12 Aug 2017 11:43:47 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1502563427; cv=none; d=google.com; s=arc-20160816; b=lxZJv+DFCPkfVpg30eUC8JcFg8jNf86WcS8fmsf6f27ReazCirI0Txr7ZHB0rAP3pd Z3xSvxoQb0sMpvQDQWfNIlWHnG7yOkHS0l4ETs1NSJ5x06IBC0spmeUCLAffXeaeXT9E grgCe9TxoGcugrFqCzJWpX93/n/XU0JxdeLfpvVegZVuJEqBVqTjQSttaWSTs5t2Tpj5 dk5ECgvCzmV9lmVAO7II7w8SsRcBtWtZBez+LamgTq9mfJW5Dy4rJM92hYM74NM5GSgV yqNW20HwHVxD4WELq7gafuXVNGiyMLGC8Gjy86jatbPJkf+Zd/+MTGhiAldSy9zWpGeh Briw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:references:in-reply-to:message-id:date :subject:cc:to:from:dkim-signature:arc-authentication-results; bh=zzTMdesdwmpBbET5Vcm6Dw67Nl6l8FmFq2Zo4723K/A=; b=GABoNgNCEnBnfZmd7psRlOd5uRjiF3Mn3lTe+MLG3+AOce8JNrLgdsdRP4nx7hGoQL 87MnpePocSneUimVQ18CUc2lcuWWkmP/GyICpMGe1qL5NJA8Qen3S0/b+FGcUv0B4vD/ aEZaox8h+3ycLJ6v7YmqF23+RG1UO3BFFpALb0uw2osmLNeWR7Bu0YSNK+3O28xfwbbc O685eCsbmwlIjApyfwEZavoDQFdU6WWDKNySwhUFzKBCYmtXy0FigieyvTwwqLOBJqc5 ws3/M1nxgopLWiNP2HfJXWvC0wbtmcZmONAm4beZDakSuOfNwvUFmhRHxgEgmuh01Zir a1yg== ARC-Authentication-Results: i=1; mx.google.com; dkim=neutral (body hash did not verify) header.i=@linaro.org header.s=google header.b=T5v3+ORN; spf=pass (google.com: best guess record for domain of linux-watchdog-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-watchdog-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id p24si2288117pli.501.2017.08.12.11.43.46 for ; Sat, 12 Aug 2017 11:43:47 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-watchdog-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=neutral (body hash did not verify) header.i=@linaro.org header.s=google header.b=T5v3+ORN; spf=pass (google.com: best guess record for domain of linux-watchdog-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-watchdog-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751490AbdHLSnq (ORCPT ); Sat, 12 Aug 2017 14:43:46 -0400 Received: from mail-lf0-f50.google.com ([209.85.215.50]:37899 "EHLO mail-lf0-f50.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750995AbdHLSnq (ORCPT ); Sat, 12 Aug 2017 14:43:46 -0400 Received: by mail-lf0-f50.google.com with SMTP id y15so26871386lfd.5 for ; Sat, 12 Aug 2017 11:43:45 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=Fl8M2PW6oA+ioimX5jKeTCiRQHo7QIyE/qIlxNbrDZ0=; b=T5v3+ORNXj0XwVCqXkICR3btGNCYnEgGfIk2xzLwIV6ICK4ycvfri/oIK9qKSU2ee/ cIzv3QVRrEsUqB4KgyRFiRr7mo1z4KqeESNjCn2TgYm1IxGTcjXINU/c0f6FEC9kUg6d /w/oH78YICg2FEEhA9VbwVGaRrCfgTH0T6WBk= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=Fl8M2PW6oA+ioimX5jKeTCiRQHo7QIyE/qIlxNbrDZ0=; b=fQY//T11rvEvCfPt5tTYUVkJ/08VMSji0zzDjmQqTTs4QsTzjf/svJKRNqm1SF11aK HcqpBmwxJereR333DGzYQRuduE/S+0spWpMje9z9kqQbVi+bNWpLJPCmHXoUXt6LspFe ReZiqUFk/kt+lCvj8SZnTmuLO1o5nEIp4YavCj/lj9QN/1/g8LNzSf2RZTytNLNihtzG HfSBAZTWVckfxkK/nXZsP5sL8cswNg+y4LVFO3jNlmCHro0jUXck7+lL9iSrbm1AMiAD MEYwcmGfpU2yTMDCtoqPk73ztDCJedft/dUOn9AmCqiL/FvCl364Pg55u9xQdMuXoIzp lqJQ== X-Gm-Message-State: AHYfb5gNagOndDECecVDmdmVc2BkfbeRIIRkXHgru1iBdGklZ50bKASW bnSIyHqlu1u8filM X-Received: by 10.25.19.24 with SMTP id j24mr7146061lfi.54.1502563424765; Sat, 12 Aug 2017 11:43:44 -0700 (PDT) Received: from fabina.bredbandsbolaget.se (c-277e71d5.014-348-6c756e10.cust.bredbandsbolaget.se. [213.113.126.39]) by smtp.gmail.com with ESMTPSA id d64sm696628lfg.22.2017.08.12.11.43.42 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Sat, 12 Aug 2017 11:43:43 -0700 (PDT) From: Linus Walleij To: Wim Van Sebroeck , Guenter Roeck , Jonas Jensen , Andrew Jeffery , Joel Stanley Cc: linux-arm-kernel@lists.infradead.org, linux-watchdog@vger.kernel.org, Linus Walleij Subject: [PATCH 07/11] watchdog: ftwdt010: Delete surplus bindings Date: Sat, 12 Aug 2017 20:43:14 +0200 Message-Id: <20170812184318.10144-8-linus.walleij@linaro.org> X-Mailer: git-send-email 2.13.4 In-Reply-To: <20170812184318.10144-1-linus.walleij@linaro.org> References: <20170812184318.10144-1-linus.walleij@linaro.org> Sender: linux-watchdog-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-watchdog@vger.kernel.org With the MOXA ART and Aspeed DT bindings covered by the FTWDT010 binding, these surplus bindings can be deleted. Signed-off-by: Linus Walleij --- .../devicetree/bindings/watchdog/aspeed-wdt.txt | 16 ---------------- .../bindings/watchdog/moxa,moxart-watchdog.txt | 15 --------------- 2 files changed, 31 deletions(-) delete mode 100644 Documentation/devicetree/bindings/watchdog/aspeed-wdt.txt delete mode 100644 Documentation/devicetree/bindings/watchdog/moxa,moxart-watchdog.txt -- 2.13.4 -- To unsubscribe from this list: send the line "unsubscribe linux-watchdog" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html diff --git a/Documentation/devicetree/bindings/watchdog/aspeed-wdt.txt b/Documentation/devicetree/bindings/watchdog/aspeed-wdt.txt deleted file mode 100644 index c5e74d7b4406..000000000000 --- a/Documentation/devicetree/bindings/watchdog/aspeed-wdt.txt +++ /dev/null @@ -1,16 +0,0 @@ -Aspeed Watchdog Timer - -Required properties: - - compatible: must be one of: - - "aspeed,ast2400-wdt" - - "aspeed,ast2500-wdt" - - - reg: physical base address of the controller and length of memory mapped - region - -Example: - - wdt1: watchdog@1e785000 { - compatible = "aspeed,ast2400-wdt"; - reg = <0x1e785000 0x1c>; - }; diff --git a/Documentation/devicetree/bindings/watchdog/moxa,moxart-watchdog.txt b/Documentation/devicetree/bindings/watchdog/moxa,moxart-watchdog.txt deleted file mode 100644 index 1169857d1d12..000000000000 --- a/Documentation/devicetree/bindings/watchdog/moxa,moxart-watchdog.txt +++ /dev/null @@ -1,15 +0,0 @@ -MOXA ART Watchdog timer - -Required properties: - -- compatible : Must be "moxa,moxart-watchdog" -- reg : Should contain registers location and length -- clocks : Should contain phandle for the clock that drives the counter - -Example: - - watchdog: watchdog@98500000 { - compatible = "moxa,moxart-watchdog"; - reg = <0x98500000 0x10>; - clocks = <&coreclk>; - }; From patchwork Sat Aug 12 18:43:15 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Linus Walleij X-Patchwork-Id: 109938 Delivered-To: patch@linaro.org Received: by 10.140.95.78 with SMTP id h72csp2442480qge; Sat, 12 Aug 2017 11:43:49 -0700 (PDT) X-Received: by 10.84.231.199 with SMTP id g7mr22327616pln.258.1502563429802; Sat, 12 Aug 2017 11:43:49 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1502563429; cv=none; d=google.com; s=arc-20160816; b=rFvvpGTJquqDCgS21ySU8LUHdSw9K954eLaL6GUCFttRJ/YkQRcjqmzcGuIlnHMWFU KvWtm3BbAx9ppX+p6CX0/ZvV2MYOK8HiaFzLPvFIgn3y/Gm7vGzUpJoRfuNXqVm3camb oKkEyQvFnG4reeVOhfnjg+d36WYnelKK3WvZVZJTTjOrfLn1e4oSv5Dyyfhi6x15HcJ2 dgx0+KAtg8CI6lyvfwsL6PmJf12ZAyMdMk9KRRwHp/8mUSFdERGbn9sl7KHBqYIZxXky 84G5nrqJydBPVsk+v4ioacL7+x5SElppAJcixKut/VzOKemwH1kcKD4BzIFKpavrlYMJ sMdw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:references:in-reply-to:message-id:date :subject:cc:to:from:dkim-signature:arc-authentication-results; bh=7skynVJBpWAgKnoU2hdj8RM8BZo7WJhmWHMvxGqzu0A=; b=jlDlvAPOGHL4BFxRQC7HcXIFHH9yTcsISMBzFbZt+Ean+1RjnvONophcAMe++rIG6g QfE/UL9YcFhHw4tmXX/XdIwSw/s2OBm75frBHNf4PQiiJh6kFsH6KaS799cWTB4mLPiF UZCYVaDiabGgfxMi4s5k3K7gGDyjlWoEYuUDrYe7J2abu7TfLE0iX+UxPw6qNxomWDsw tA2hoB4tvl8QCosUHfImTPwSk3FVGSE/cswXQqtulNPQLI8xgTeHi71+/U3hUfjRj38P ZJw6vXCDRJpWyoYtXPAvlPR6Q457zfdbG29YpYSSlJ3NJAC0pWE50Wj21kmuvUXyVHia aRmA== ARC-Authentication-Results: i=1; mx.google.com; dkim=neutral (body hash did not verify) header.i=@linaro.org header.s=google header.b=ZHm0IzPZ; spf=pass (google.com: best guess record for domain of linux-watchdog-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-watchdog-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id p24si2288117pli.501.2017.08.12.11.43.49 for ; Sat, 12 Aug 2017 11:43:49 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-watchdog-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=neutral (body hash did not verify) header.i=@linaro.org header.s=google header.b=ZHm0IzPZ; spf=pass (google.com: best guess record for domain of linux-watchdog-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-watchdog-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751549AbdHLSnt (ORCPT ); Sat, 12 Aug 2017 14:43:49 -0400 Received: from mail-lf0-f49.google.com ([209.85.215.49]:34605 "EHLO mail-lf0-f49.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750995AbdHLSns (ORCPT ); Sat, 12 Aug 2017 14:43:48 -0400 Received: by mail-lf0-f49.google.com with SMTP id g25so26978782lfh.1 for ; Sat, 12 Aug 2017 11:43:47 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=+jmL78IBUW2o9Ci/qkluReUl1xDkPejsMXedEFrEcYI=; b=ZHm0IzPZbcLvpfGRSIzf9F2iHbPRlJlVFUpP0Lo8wmWZu8n0Ma1/CldlPzUjRsRsnB h+HmTxJ8B/gAu19bXT8JbpVL9hwwxTpSjxuuyGb7SQf2PIgeecGex+qjfGID/+eUABx5 ZtruImzYsacsdOsRaSHtFl9ad3mq1xlC+9aOc= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=+jmL78IBUW2o9Ci/qkluReUl1xDkPejsMXedEFrEcYI=; b=LxUnD+jyndUxdJ6Ag1u3r1sHiehTuALxZ6sxM7rbadQGDos3FILfHZZBOOPdiFBLSk 4O6snA4s/2svYt25jDf6gfAddXH7FbkWvm5obPGpuFvXNU1ffe6AxbzCOlCiP/SYfTsE TKEcDXbgpbbfpMcX1/pl9/b7/7EtnoaWIbP0DjJB9uazTuuA8Vjnrkrzx7vKEBvcm5VU a4fy+VIwqZJ+B/3mwBWett7QGC6X4KB2LTfntlmbCa+/uxl9b3WD4IIq/sAuTNz/kujd 0hnTtEHw8ZE+yO/G/LOjcel8p0dBTKfracwfvgOyeUtn6jdX2yCElG1cnyO+VGxSZeLG zsQQ== X-Gm-Message-State: AHYfb5jaAHzA6JB45GD6h/yHApaDlya3uowh7IVBpsctPlg36bOR+cef TRezQgQsUhkNKnmS X-Received: by 10.25.196.23 with SMTP id u23mr7033090lff.238.1502563427218; Sat, 12 Aug 2017 11:43:47 -0700 (PDT) Received: from fabina.bredbandsbolaget.se (c-277e71d5.014-348-6c756e10.cust.bredbandsbolaget.se. [213.113.126.39]) by smtp.gmail.com with ESMTPSA id d64sm696628lfg.22.2017.08.12.11.43.45 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Sat, 12 Aug 2017 11:43:46 -0700 (PDT) From: Linus Walleij To: Wim Van Sebroeck , Guenter Roeck , Jonas Jensen , Andrew Jeffery , Joel Stanley Cc: linux-arm-kernel@lists.infradead.org, linux-watchdog@vger.kernel.org, Linus Walleij Subject: [PATCH 08/11] watchdog: ftwdt010/moxart: Merge MOXA ART into FTWDT010 Date: Sat, 12 Aug 2017 20:43:15 +0200 Message-Id: <20170812184318.10144-9-linus.walleij@linaro.org> X-Mailer: git-send-email 2.13.4 In-Reply-To: <20170812184318.10144-1-linus.walleij@linaro.org> References: <20170812184318.10144-1-linus.walleij@linaro.org> Sender: linux-watchdog-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-watchdog@vger.kernel.org These two drivers is for the same hardware, the only difference is that Gemini uses the EXTCLK @5MHz by default (it also works fine using PCLK) while the MOXA ART is using the PCLK to clock the watchdog. Delete the old MOXA ART driver and augment the FTWDT010 to probe on this platform too, fetching the operating frequency from the PCLK. Select the driver by default for ARCH_MOXART to make a smooth transition of the platform. Signed-off-by: Linus Walleij --- drivers/watchdog/Kconfig | 11 +-- drivers/watchdog/Makefile | 1 - drivers/watchdog/ftwdt010_wdt.c | 1 + drivers/watchdog/moxart_wdt.c | 178 ---------------------------------------- 4 files changed, 2 insertions(+), 189 deletions(-) delete mode 100644 drivers/watchdog/moxart_wdt.c -- 2.13.4 -- To unsubscribe from this list: send the line "unsubscribe linux-watchdog" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html diff --git a/drivers/watchdog/Kconfig b/drivers/watchdog/Kconfig index fd44a542036a..beef6bb5c6d9 100644 --- a/drivers/watchdog/Kconfig +++ b/drivers/watchdog/Kconfig @@ -326,6 +326,7 @@ config FTWDT010_WATCHDOG depends on ARM || COMPILE_TEST select WATCHDOG_CORE default ARCH_GEMINI + default ARCH_MOXART help Say Y here if to include support for the Faraday Technology FTWDT010 watchdog timer embedded in the Cortina Systems Gemini @@ -609,16 +610,6 @@ config RETU_WATCHDOG To compile this driver as a module, choose M here: the module will be called retu_wdt. -config MOXART_WDT - tristate "MOXART watchdog" - depends on ARCH_MOXART || COMPILE_TEST - help - Say Y here to include Watchdog timer support for the watchdog - existing on the MOXA ART SoC series platforms. - - To compile this driver as a module, choose M here: the - module will be called moxart_wdt. - config SIRFSOC_WATCHDOG tristate "SiRFSOC watchdog" depends on ARCH_SIRF || COMPILE_TEST diff --git a/drivers/watchdog/Makefile b/drivers/watchdog/Makefile index df91d7db821c..fcab71f0a1c7 100644 --- a/drivers/watchdog/Makefile +++ b/drivers/watchdog/Makefile @@ -68,7 +68,6 @@ obj-$(CONFIG_IMX2_WDT) += imx2_wdt.o obj-$(CONFIG_UX500_WATCHDOG) += ux500_wdt.o obj-$(CONFIG_RETU_WATCHDOG) += retu_wdt.o obj-$(CONFIG_BCM2835_WDT) += bcm2835_wdt.o -obj-$(CONFIG_MOXART_WDT) += moxart_wdt.o obj-$(CONFIG_SIRFSOC_WATCHDOG) += sirfsoc_wdt.o obj-$(CONFIG_ST_LPC_WATCHDOG) += st_lpc_wdt.o obj-$(CONFIG_QCOM_WDT) += qcom-wdt.o diff --git a/drivers/watchdog/ftwdt010_wdt.c b/drivers/watchdog/ftwdt010_wdt.c index 7fc865eea28d..912b55e67110 100644 --- a/drivers/watchdog/ftwdt010_wdt.c +++ b/drivers/watchdog/ftwdt010_wdt.c @@ -298,6 +298,7 @@ static const struct dev_pm_ops ftwdt010_wdt_dev_pm_ops = { static const struct of_device_id ftwdt010_wdt_match[] = { { .compatible = "faraday,ftwdt010" }, { .compatible = "cortina,gemini-watchdog" }, + { .compatible = "moxa,moxart-watchdog" }, {}, }; MODULE_DEVICE_TABLE(of, ftwdt010_wdt_match); diff --git a/drivers/watchdog/moxart_wdt.c b/drivers/watchdog/moxart_wdt.c deleted file mode 100644 index 2c4a73d1e214..000000000000 --- a/drivers/watchdog/moxart_wdt.c +++ /dev/null @@ -1,178 +0,0 @@ -/* - * MOXA ART SoCs watchdog driver. - * - * Copyright (C) 2013 Jonas Jensen - * - * Jonas Jensen - * - * This file is licensed under the terms of the GNU General Public - * License version 2. This program is licensed "as is" without any - * warranty of any kind, whether express or implied. - */ - -#include -#include -#include -#include -#include -#include -#include -#include - -#define REG_COUNT 0x4 -#define REG_MODE 0x8 -#define REG_ENABLE 0xC - -struct moxart_wdt_dev { - struct watchdog_device dev; - void __iomem *base; - unsigned int clock_frequency; -}; - -static int heartbeat; - -static int moxart_wdt_restart(struct watchdog_device *wdt_dev, - unsigned long action, void *data) -{ - struct moxart_wdt_dev *moxart_wdt = watchdog_get_drvdata(wdt_dev); - - writel(1, moxart_wdt->base + REG_COUNT); - writel(0x5ab9, moxart_wdt->base + REG_MODE); - writel(0x03, moxart_wdt->base + REG_ENABLE); - - return 0; -} - -static int moxart_wdt_stop(struct watchdog_device *wdt_dev) -{ - struct moxart_wdt_dev *moxart_wdt = watchdog_get_drvdata(wdt_dev); - - writel(0, moxart_wdt->base + REG_ENABLE); - - return 0; -} - -static int moxart_wdt_start(struct watchdog_device *wdt_dev) -{ - struct moxart_wdt_dev *moxart_wdt = watchdog_get_drvdata(wdt_dev); - - writel(moxart_wdt->clock_frequency * wdt_dev->timeout, - moxart_wdt->base + REG_COUNT); - writel(0x5ab9, moxart_wdt->base + REG_MODE); - writel(0x03, moxart_wdt->base + REG_ENABLE); - - return 0; -} - -static int moxart_wdt_set_timeout(struct watchdog_device *wdt_dev, - unsigned int timeout) -{ - wdt_dev->timeout = timeout; - - return 0; -} - -static const struct watchdog_info moxart_wdt_info = { - .identity = "moxart-wdt", - .options = WDIOF_SETTIMEOUT | WDIOF_KEEPALIVEPING | - WDIOF_MAGICCLOSE, -}; - -static const struct watchdog_ops moxart_wdt_ops = { - .owner = THIS_MODULE, - .start = moxart_wdt_start, - .stop = moxart_wdt_stop, - .set_timeout = moxart_wdt_set_timeout, - .restart = moxart_wdt_restart, -}; - -static int moxart_wdt_probe(struct platform_device *pdev) -{ - struct moxart_wdt_dev *moxart_wdt; - struct device *dev = &pdev->dev; - struct device_node *node = dev->of_node; - struct resource *res; - struct clk *clk; - int err; - unsigned int max_timeout; - bool nowayout = WATCHDOG_NOWAYOUT; - - moxart_wdt = devm_kzalloc(dev, sizeof(*moxart_wdt), GFP_KERNEL); - if (!moxart_wdt) - return -ENOMEM; - - platform_set_drvdata(pdev, moxart_wdt); - - res = platform_get_resource(pdev, IORESOURCE_MEM, 0); - moxart_wdt->base = devm_ioremap_resource(dev, res); - if (IS_ERR(moxart_wdt->base)) - return PTR_ERR(moxart_wdt->base); - - clk = of_clk_get(node, 0); - if (IS_ERR(clk)) { - pr_err("%s: of_clk_get failed\n", __func__); - return PTR_ERR(clk); - } - - moxart_wdt->clock_frequency = clk_get_rate(clk); - if (moxart_wdt->clock_frequency == 0) { - pr_err("%s: incorrect clock frequency\n", __func__); - return -EINVAL; - } - - max_timeout = UINT_MAX / moxart_wdt->clock_frequency; - - moxart_wdt->dev.info = &moxart_wdt_info; - moxart_wdt->dev.ops = &moxart_wdt_ops; - moxart_wdt->dev.timeout = max_timeout; - moxart_wdt->dev.min_timeout = 1; - moxart_wdt->dev.max_timeout = max_timeout; - moxart_wdt->dev.parent = dev; - - watchdog_init_timeout(&moxart_wdt->dev, heartbeat, dev); - watchdog_set_nowayout(&moxart_wdt->dev, nowayout); - watchdog_set_restart_priority(&moxart_wdt->dev, 128); - - watchdog_set_drvdata(&moxart_wdt->dev, moxart_wdt); - - err = watchdog_register_device(&moxart_wdt->dev); - if (err) - return err; - - dev_dbg(dev, "Watchdog enabled (heartbeat=%d sec, nowayout=%d)\n", - moxart_wdt->dev.timeout, nowayout); - - return 0; -} - -static int moxart_wdt_remove(struct platform_device *pdev) -{ - struct moxart_wdt_dev *moxart_wdt = platform_get_drvdata(pdev); - - moxart_wdt_stop(&moxart_wdt->dev); - - return 0; -} - -static const struct of_device_id moxart_watchdog_match[] = { - { .compatible = "moxa,moxart-watchdog" }, - { }, -}; -MODULE_DEVICE_TABLE(of, moxart_watchdog_match); - -static struct platform_driver moxart_wdt_driver = { - .probe = moxart_wdt_probe, - .remove = moxart_wdt_remove, - .driver = { - .name = "moxart-watchdog", - .of_match_table = moxart_watchdog_match, - }, -}; -module_platform_driver(moxart_wdt_driver); - -module_param(heartbeat, int, 0); -MODULE_PARM_DESC(heartbeat, "Watchdog heartbeat in seconds"); - -MODULE_DESCRIPTION("MOXART watchdog driver"); -MODULE_LICENSE("GPL"); -MODULE_AUTHOR("Jonas Jensen "); From patchwork Sat Aug 12 18:43:16 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Linus Walleij X-Patchwork-Id: 109939 Delivered-To: patch@linaro.org Received: by 10.140.95.78 with SMTP id h72csp2442507qge; Sat, 12 Aug 2017 11:43:52 -0700 (PDT) X-Received: by 10.99.171.69 with SMTP id k5mr19256256pgp.248.1502563432173; Sat, 12 Aug 2017 11:43:52 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1502563432; cv=none; d=google.com; s=arc-20160816; b=rNMPtXW8707/hDrbNY1Lajy1IaanCGr3gYksOapapd61P73HvuGz5AGtmfe7R2Y0L8 Tm5bd6uqllGv4EHh9GIGyBqT79eMxK05SkWyuYd+Man/69qN3+qg61tV+s0m1vc8fn0K oh6jKKwtNYSZDJtKGOjp95ChF7cNAqu4ePJV6iIasT9fVU9stBUVP2R2/wtDpWiuDXwt 6xYxRAvwIJg4s4clbYvubDspQf0ke75vEJq9CjKuEDRXaKRQmYzCIkWFMwA0JFlYeuxj H6uaEnW1vnluLGnx3ShMoFCkbYkBrakC1cIO0RmHgoyIbdmvRM33aonVEZCuvsgRnakR vFUg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:references:in-reply-to:message-id:date :subject:cc:to:from:dkim-signature:arc-authentication-results; bh=22H0tvLfgeK/M/DKgEYC8edLzQCdanciIxpj+vaYa5E=; b=ghAN6lGzWJGLIouwkAGMC9iW8y8pDp2LXA21DIxV8lf68pj279/QzgkgFL+nYb3f8G Iuy5yEd+0LEbJK2roqR5KArvFug5USpkrtwiSV4XiFKJ+NbZM99oKyWW4i6prHZyvdfv QdtdoP5M3ljqvF+04CQLEbYZm2mCp6ERo72lgbdx/gso4PEIFsIR8CZE9FHAHnGKxDkB OQW1zw7sRbgT/idHDyMaRuWVsJQPLE9gA2cY4PUFUw2yFbn5KYyGFHN+Vgz96se3rhxl d0RtnRoXNOx7fnEl3TVMuibXOTpD6FZXP+RkUfypaig3qjnsklj/6EnytQk1HQMJR+fR HgPg== ARC-Authentication-Results: i=1; mx.google.com; dkim=neutral (body hash did not verify) header.i=@linaro.org header.s=google header.b=JSC9LAoC; spf=pass (google.com: best guess record for domain of linux-watchdog-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-watchdog-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id p24si2288117pli.501.2017.08.12.11.43.52 for ; Sat, 12 Aug 2017 11:43:52 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-watchdog-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=neutral (body hash did not verify) header.i=@linaro.org header.s=google header.b=JSC9LAoC; spf=pass (google.com: best guess record for domain of linux-watchdog-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-watchdog-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751567AbdHLSnv (ORCPT ); Sat, 12 Aug 2017 14:43:51 -0400 Received: from mail-lf0-f52.google.com ([209.85.215.52]:33641 "EHLO mail-lf0-f52.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751086AbdHLSnv (ORCPT ); Sat, 12 Aug 2017 14:43:51 -0400 Received: by mail-lf0-f52.google.com with SMTP id d17so27046954lfe.0 for ; Sat, 12 Aug 2017 11:43:50 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=woxZIBowQVMddKCVWWUfypM03y25jUMDkiMJF7HmE4E=; b=JSC9LAoC8fi0VhWlu5aJM58YeFR9sDMo8RdhalbP/TCxatJTJq++jE3Ipld/td4qR7 PoisI8KNp5oq2QwK+f79UQ5II+L5BVvHzeGGd3OoPEbVUyovaXZy429cUsG0CGdGLOyB osg+HaQL9N6gmzE2NwkeMd2RyPzpy1k/Wo/RQ= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=woxZIBowQVMddKCVWWUfypM03y25jUMDkiMJF7HmE4E=; b=JXXsPXxh/LW68gWhdzCBmLvH910KHCOtsBNSE9N5syOYcljZVUVGrwjEIn/uagkoSO RsUXdjX8emb/DP5ep0spUgE/SN8fx/zYuisXg8/fEQS2lyxuc75EciUEwgc846nEVwAd 7i08uzXufWnDmnYX2ic5eMVRGUXN7sVQQDL901POy1ctTvXjY8jTBDe78l/i+44VCK+y Kz9S6oNpHUD83C9ho5m4mPKXX/CvXGJK24KksSEgabVr7Thz+Q996EZIKlMB3ZaLjySi 7ZbRFG0lmCJ7/vSbx3yJjRbZNp6AybIp+2amB1kwLyJJHqr+1uxK9CHYvjT9iFRLr9/w av2A== X-Gm-Message-State: AHYfb5i/lLxv4YdElDN69OZ+GghEtxbpLf7BOTpMzWPA0+cNb9vfI5F0 ZTd1xNmbhGgaw6GW X-Received: by 10.25.40.70 with SMTP id o67mr7716110lfo.151.1502563429548; Sat, 12 Aug 2017 11:43:49 -0700 (PDT) Received: from fabina.bredbandsbolaget.se (c-277e71d5.014-348-6c756e10.cust.bredbandsbolaget.se. [213.113.126.39]) by smtp.gmail.com with ESMTPSA id d64sm696628lfg.22.2017.08.12.11.43.47 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Sat, 12 Aug 2017 11:43:48 -0700 (PDT) From: Linus Walleij To: Wim Van Sebroeck , Guenter Roeck , Jonas Jensen , Andrew Jeffery , Joel Stanley Cc: linux-arm-kernel@lists.infradead.org, linux-watchdog@vger.kernel.org, Linus Walleij Subject: [PATCH 09/11] watchdog: ftwdt010/aspeed: Merge Aspeed into FTWDT010 Date: Sat, 12 Aug 2017 20:43:16 +0200 Message-Id: <20170812184318.10144-10-linus.walleij@linaro.org> X-Mailer: git-send-email 2.13.4 In-Reply-To: <20170812184318.10144-1-linus.walleij@linaro.org> References: <20170812184318.10144-1-linus.walleij@linaro.org> Sender: linux-watchdog-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-watchdog@vger.kernel.org These two drivers is for the almost the same hardware, the only differences are: - The Aspeed IP block has been hacked to use a different magic value. - The Aspeed has hard-wired 1MHz to the EXTCLK and apparently even disabled the use of PCLK for clocking the block on AST2500. Delete the old Aspeed driver and augment the FTWDT010 to probe on this platform too. Select the driver by default for ARCH_ASPEED to make a smooth transition of the platform. Signed-off-by: Linus Walleij --- drivers/watchdog/Kconfig | 18 +--- drivers/watchdog/Makefile | 1 - drivers/watchdog/aspeed_wdt.c | 200 ---------------------------------------- drivers/watchdog/ftwdt010_wdt.c | 25 ++++- 4 files changed, 25 insertions(+), 219 deletions(-) delete mode 100644 drivers/watchdog/aspeed_wdt.c -- 2.13.4 -- To unsubscribe from this list: send the line "unsubscribe linux-watchdog" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html diff --git a/drivers/watchdog/Kconfig b/drivers/watchdog/Kconfig index beef6bb5c6d9..0296fab14c35 100644 --- a/drivers/watchdog/Kconfig +++ b/drivers/watchdog/Kconfig @@ -327,10 +327,11 @@ config FTWDT010_WATCHDOG select WATCHDOG_CORE default ARCH_GEMINI default ARCH_MOXART + default ARCH_ASPEED help Say Y here if to include support for the Faraday Technology - FTWDT010 watchdog timer embedded in the Cortina Systems Gemini - family of devices. + FTWDT010 watchdog timer embedded in the Cortina Systems Gemini, + MOXA ART and Aspeed families of devices. To compile this driver as a module, choose M here: the module will be called ftwdt010_wdt. @@ -733,19 +734,6 @@ config RENESAS_RZAWDT This driver adds watchdog support for the integrated watchdogs in the Renesas RZ/A SoCs. These watchdogs can be used to reset a system. -config ASPEED_WATCHDOG - tristate "Aspeed 2400 watchdog support" - depends on ARCH_ASPEED || COMPILE_TEST - select WATCHDOG_CORE - help - Say Y here to include support for the watchdog timer - in Apseed BMC SoCs. - - This driver is required to reboot the SoC. - - To compile this driver as a module, choose M here: the - module will be called aspeed_wdt. - config ZX2967_WATCHDOG tristate "ZTE zx2967 SoCs watchdog support" depends on ARCH_ZX diff --git a/drivers/watchdog/Makefile b/drivers/watchdog/Makefile index fcab71f0a1c7..a9701d39928d 100644 --- a/drivers/watchdog/Makefile +++ b/drivers/watchdog/Makefile @@ -82,7 +82,6 @@ obj-$(CONFIG_BCM7038_WDT) += bcm7038_wdt.o obj-$(CONFIG_ATLAS7_WATCHDOG) += atlas7_wdt.o obj-$(CONFIG_RENESAS_WDT) += renesas_wdt.o obj-$(CONFIG_RENESAS_RZAWDT) += rza_wdt.o -obj-$(CONFIG_ASPEED_WATCHDOG) += aspeed_wdt.o obj-$(CONFIG_ZX2967_WATCHDOG) += zx2967_wdt.o obj-$(CONFIG_STM32_WATCHDOG) += stm32_iwdg.o obj-$(CONFIG_UNIPHIER_WATCHDOG) += uniphier_wdt.o diff --git a/drivers/watchdog/aspeed_wdt.c b/drivers/watchdog/aspeed_wdt.c deleted file mode 100644 index 1c652582de40..000000000000 --- a/drivers/watchdog/aspeed_wdt.c +++ /dev/null @@ -1,200 +0,0 @@ -/* - * Copyright 2016 IBM Corporation - * - * Joel Stanley - * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License - * as published by the Free Software Foundation; either version - * 2 of the License, or (at your option) any later version. - */ - -#include -#include -#include -#include -#include -#include -#include - -struct aspeed_wdt { - struct watchdog_device wdd; - void __iomem *base; - u32 ctrl; -}; - -static const struct of_device_id aspeed_wdt_of_table[] = { - { .compatible = "aspeed,ast2400-wdt" }, - { .compatible = "aspeed,ast2500-wdt" }, - { }, -}; -MODULE_DEVICE_TABLE(of, aspeed_wdt_of_table); - -#define WDT_STATUS 0x00 -#define WDT_RELOAD_VALUE 0x04 -#define WDT_RESTART 0x08 -#define WDT_CTRL 0x0C -#define WDT_CTRL_RESET_MODE_SOC (0x00 << 5) -#define WDT_CTRL_RESET_MODE_FULL_CHIP (0x01 << 5) -#define WDT_CTRL_1MHZ_CLK BIT(4) -#define WDT_CTRL_WDT_EXT BIT(3) -#define WDT_CTRL_WDT_INTR BIT(2) -#define WDT_CTRL_RESET_SYSTEM BIT(1) -#define WDT_CTRL_ENABLE BIT(0) - -#define WDT_RESTART_MAGIC 0x4755 - -/* 32 bits at 1MHz, in milliseconds */ -#define WDT_MAX_TIMEOUT_MS 4294967 -#define WDT_DEFAULT_TIMEOUT 30 -#define WDT_RATE_1MHZ 1000000 - -static struct aspeed_wdt *to_aspeed_wdt(struct watchdog_device *wdd) -{ - return container_of(wdd, struct aspeed_wdt, wdd); -} - -static void aspeed_wdt_enable(struct aspeed_wdt *wdt, int count) -{ - wdt->ctrl |= WDT_CTRL_ENABLE; - - writel(0, wdt->base + WDT_CTRL); - writel(count, wdt->base + WDT_RELOAD_VALUE); - writel(WDT_RESTART_MAGIC, wdt->base + WDT_RESTART); - writel(wdt->ctrl, wdt->base + WDT_CTRL); -} - -static int aspeed_wdt_start(struct watchdog_device *wdd) -{ - struct aspeed_wdt *wdt = to_aspeed_wdt(wdd); - - aspeed_wdt_enable(wdt, wdd->timeout * WDT_RATE_1MHZ); - - return 0; -} - -static int aspeed_wdt_stop(struct watchdog_device *wdd) -{ - struct aspeed_wdt *wdt = to_aspeed_wdt(wdd); - - wdt->ctrl &= ~WDT_CTRL_ENABLE; - writel(wdt->ctrl, wdt->base + WDT_CTRL); - - return 0; -} - -static int aspeed_wdt_ping(struct watchdog_device *wdd) -{ - struct aspeed_wdt *wdt = to_aspeed_wdt(wdd); - - writel(WDT_RESTART_MAGIC, wdt->base + WDT_RESTART); - - return 0; -} - -static int aspeed_wdt_set_timeout(struct watchdog_device *wdd, - unsigned int timeout) -{ - struct aspeed_wdt *wdt = to_aspeed_wdt(wdd); - u32 actual; - - wdd->timeout = timeout; - - actual = min(timeout, wdd->max_hw_heartbeat_ms * 1000); - - writel(actual * WDT_RATE_1MHZ, wdt->base + WDT_RELOAD_VALUE); - writel(WDT_RESTART_MAGIC, wdt->base + WDT_RESTART); - - return 0; -} - -static int aspeed_wdt_restart(struct watchdog_device *wdd, - unsigned long action, void *data) -{ - struct aspeed_wdt *wdt = to_aspeed_wdt(wdd); - - aspeed_wdt_enable(wdt, 128 * WDT_RATE_1MHZ / 1000); - - mdelay(1000); - - return 0; -} - -static const struct watchdog_ops aspeed_wdt_ops = { - .start = aspeed_wdt_start, - .stop = aspeed_wdt_stop, - .ping = aspeed_wdt_ping, - .set_timeout = aspeed_wdt_set_timeout, - .restart = aspeed_wdt_restart, - .owner = THIS_MODULE, -}; - -static const struct watchdog_info aspeed_wdt_info = { - .options = WDIOF_KEEPALIVEPING - | WDIOF_MAGICCLOSE - | WDIOF_SETTIMEOUT, - .identity = KBUILD_MODNAME, -}; - -static int aspeed_wdt_probe(struct platform_device *pdev) -{ - struct aspeed_wdt *wdt; - struct resource *res; - int ret; - - wdt = devm_kzalloc(&pdev->dev, sizeof(*wdt), GFP_KERNEL); - if (!wdt) - return -ENOMEM; - - res = platform_get_resource(pdev, IORESOURCE_MEM, 0); - wdt->base = devm_ioremap_resource(&pdev->dev, res); - 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; - wdt->wdd.parent = &pdev->dev; - - wdt->wdd.timeout = WDT_DEFAULT_TIMEOUT; - watchdog_init_timeout(&wdt->wdd, 0, &pdev->dev); - - /* - * Control reset on a per-device basis to ensure the - * host is not affected by a BMC reboot, so only reset - * the SOC and not the full chip - */ - wdt->ctrl = WDT_CTRL_RESET_MODE_SOC | - WDT_CTRL_1MHZ_CLK | - WDT_CTRL_RESET_SYSTEM; - - if (readl(wdt->base + WDT_CTRL) & WDT_CTRL_ENABLE) { - aspeed_wdt_start(&wdt->wdd); - set_bit(WDOG_HW_RUNNING, &wdt->wdd.status); - } - - ret = devm_watchdog_register_device(&pdev->dev, &wdt->wdd); - if (ret) { - dev_err(&pdev->dev, "failed to register\n"); - return ret; - } - - return 0; -} - -static struct platform_driver aspeed_watchdog_driver = { - .probe = aspeed_wdt_probe, - .driver = { - .name = KBUILD_MODNAME, - .of_match_table = of_match_ptr(aspeed_wdt_of_table), - }, -}; -module_platform_driver(aspeed_watchdog_driver); - -MODULE_DESCRIPTION("Aspeed Watchdog Driver"); -MODULE_LICENSE("GPL"); diff --git a/drivers/watchdog/ftwdt010_wdt.c b/drivers/watchdog/ftwdt010_wdt.c index 912b55e67110..072da594bcbd 100644 --- a/drivers/watchdog/ftwdt010_wdt.c +++ b/drivers/watchdog/ftwdt010_wdt.c @@ -7,6 +7,8 @@ * Copyright (C) 2009 Paulius Zaleckas * Inspired by the MOXA ART driver from Jonas Jensen: * Copyright (C) 2013 Jonas Jensen + * Inspired by the Aspeed driver from Joel Stanley : + * Copyright 2016 IBM Corporation * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License version 2 as @@ -32,7 +34,9 @@ #define FTWDT010_WDCR 0xC #define WDRESTART_MAGIC 0x5AB9 +#define ASPEED_MAGIC 0x4755 +#define ASPEED_RESET_FULL_CHIP BIT(5) #define WDCR_EXTCLK BIT(4) #define WDCR_WDEXT BIT(3) #define WDCR_WDINTR BIT(2) @@ -48,6 +52,7 @@ struct ftwdt010_wdt { struct clk *extclk; unsigned int clk_freq; bool use_extclk; + u32 magic; }; static inline @@ -63,7 +68,7 @@ static int ftwdt010_wdt_restart(struct watchdog_device *wdd, u32 enable; writel(1, gwdt->base + FTWDT010_WDLOAD); - writel(WDRESTART_MAGIC, gwdt->base + FTWDT010_WDRESTART); + writel(gwdt->magic, gwdt->base + FTWDT010_WDRESTART); enable = WDCR_SYS_RST | WDCR_ENABLE; if (gwdt->use_extclk) enable |= WDCR_EXTCLK; @@ -78,7 +83,7 @@ static int ftwdt010_wdt_start(struct watchdog_device *wdd) u32 enable; writel(wdd->timeout * gwdt->clk_freq, gwdt->base + FTWDT010_WDLOAD); - writel(WDRESTART_MAGIC, gwdt->base + FTWDT010_WDRESTART); + writel(gwdt->magic, gwdt->base + FTWDT010_WDRESTART); /* set clock before enabling */ enable = WDCR_SYS_RST; if (gwdt->use_extclk) @@ -105,7 +110,7 @@ static int ftwdt010_wdt_ping(struct watchdog_device *wdd) { struct ftwdt010_wdt *gwdt = to_ftwdt010_wdt(wdd); - writel(WDRESTART_MAGIC, gwdt->base + FTWDT010_WDRESTART); + writel(gwdt->magic, gwdt->base + FTWDT010_WDRESTART); return 0; } @@ -153,6 +158,7 @@ static int ftwdt010_wdt_probe(struct platform_device *pdev) struct resource *res; struct ftwdt010_wdt *gwdt; unsigned int reg; + bool is_aspeed; int irq; int ret; @@ -167,6 +173,10 @@ static int ftwdt010_wdt_probe(struct platform_device *pdev) gwdt->use_extclk = of_property_read_bool(np, "faraday,use-extclk"); + /* We want to know if we are aspeed */ + is_aspeed = of_device_is_compatible(np, "aspeed,ast2400-wdt") || + of_device_is_compatible(np, "aspeed,ast2500-wdt"); + gwdt->pclk = devm_clk_get(dev, "PCLK"); if (!IS_ERR(gwdt->pclk)) { ret = clk_prepare_enable(gwdt->pclk); @@ -198,6 +208,11 @@ static int ftwdt010_wdt_probe(struct platform_device *pdev) gwdt->use_extclk = true; dev_info(dev, "assume 5MHz EXTCLK on Gemini\n"); } + if (is_aspeed) { + gwdt->clk_freq = 1000000; + gwdt->use_extclk = true; + dev_info(dev, "assume 1MHz EXTCLK on Aspeed\n"); + } } if (gwdt->clk_freq == 0) { @@ -211,6 +226,10 @@ static int ftwdt010_wdt_probe(struct platform_device *pdev) gwdt->wdd.min_timeout = 1; gwdt->wdd.max_timeout = UINT_MAX / gwdt->clk_freq; gwdt->wdd.parent = dev; + if (is_aspeed) + gwdt->magic = ASPEED_MAGIC; + else + gwdt->magic = WDRESTART_MAGIC; /* * If 'timeout-sec' unspecified in devicetree, assume a 13 second From patchwork Sat Aug 12 18:43:17 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Linus Walleij X-Patchwork-Id: 109940 Delivered-To: patch@linaro.org Received: by 10.140.95.78 with SMTP id h72csp2442544qge; Sat, 12 Aug 2017 11:43:54 -0700 (PDT) X-Received: by 10.98.155.153 with SMTP id e25mr20478541pfk.109.1502563434514; Sat, 12 Aug 2017 11:43:54 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1502563434; cv=none; d=google.com; s=arc-20160816; b=SqJoHBdnZ4v6edZc4c5uqfI0ZdYOsjeif56FINiIM1F+DmcFJD++PAp6cl9VpEMCO3 TWfTnoOPFJglWHgrT7yGtZsKl+ANNcU597TpV/NIKY0l/n7sktEsda7bGeWhFUKMErY/ zPHbeBhqsr2ouS+HfffGUQWfaXtmWz760BLRA+JOUWRn0ix6fM21T5iBqQDxjpcrjay5 zNr6Ekh5mdPj1GGSi1OWEJEoktEG6DbYTZ4DdGIPHkOXFuIfVTHW8qXbV+4gnGXmcdXo isJczLVJkjrKC16jWJHCeJzIeW3AZ2DWAlAhxJbkpYHWzdZhZ2EJflvN8nYDY92T5ZHS Pv2A== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:references:in-reply-to:message-id:date :subject:cc:to:from:dkim-signature:arc-authentication-results; bh=CuydwPTsZLrc7bMqBMztaOJOGyyo7Fmve6xOsCgk9g4=; b=DIpMgiEVbwaxD/N0NvOR0Olnb74rNVjYYXUF4IugTh1bv4xsCE1IdUv1XMT8zUAaoU Z/VF/WhqKLAMw0QJgmOP9ZAxmm1XAw1dxESqJrGS7e52K57UkSy5TXqGnUP/UzDOKaSc lM++0hbHUQVjslQquBTwHlwBlrjooPEXAGELimU6PmGsCBgXujooJR6xC4G40Ulr7jwb TD9zdvbKxNBykQYnQ6HuBHPX9qxU5D97EH/0nr2eAWRm+x4yESP1owsmm+PibaBtp6sB Nb3c+XcoUqKDJa0CjPlCGUUwhWVHHIx02O3vWGVFcYDiweLw6reOjsZ8h/STDjCsrtkW 7tlQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=neutral (body hash did not verify) header.i=@linaro.org header.s=google header.b=LdLxgD4v; spf=pass (google.com: best guess record for domain of linux-watchdog-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-watchdog-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id p24si2288117pli.501.2017.08.12.11.43.54 for ; Sat, 12 Aug 2017 11:43:54 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-watchdog-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=neutral (body hash did not verify) header.i=@linaro.org header.s=google header.b=LdLxgD4v; spf=pass (google.com: best guess record for domain of linux-watchdog-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-watchdog-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751703AbdHLSny (ORCPT ); Sat, 12 Aug 2017 14:43:54 -0400 Received: from mail-lf0-f49.google.com ([209.85.215.49]:36323 "EHLO mail-lf0-f49.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751624AbdHLSnx (ORCPT ); Sat, 12 Aug 2017 14:43:53 -0400 Received: by mail-lf0-f49.google.com with SMTP id o85so26909236lff.3 for ; Sat, 12 Aug 2017 11:43:53 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=ZO2LWjRKQrK7hUO2iVUElMs6qbWniSok1D7WfAavIN0=; b=LdLxgD4vTyu5tpzWacIK8BBKpjiQHv/5llOhvIzkwLkQBrT77h2V9YyvGmrEJya3Rr Z1/H2RuNxQcDj8IN3stDlRVuw+o7aqjocfDRxpa+RN6r9gbNIjt5SU39sIji45J73lVW 6lBibjFyPFABkzHQVbOQ2pCbSHhbZFJz6UM3o= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=ZO2LWjRKQrK7hUO2iVUElMs6qbWniSok1D7WfAavIN0=; b=fx06IdqqyTfAWxkq8NVuVKqMgSq7Rw0GUbINX7RjPNZNuRlZwktBIO0jnddcxqST8z 81Ds1wXWLN/WITYs7lvSAGc4yV33fXXeHGZLfTaeRtd9eXY0JVN5qtmyUzbnhbjiUGtn ClwvZRjr1KNszBdIdgSIC+k/sd/XVxyfSCICf2KFlQRgkVcJMxkI+bljEoLxjTxWbZdE hHA38ogB6SWLX4lEgwb6nhM2Dhv01jYFknJd7fwMWJIgFfUKxTUBRmkQD70LW8TzBaZZ 9DmpvL1onoesigo0VozUJ5JlZb6VsJ9NhABYOq4D/BuW+r9Ya7zmjXH4dOAT/5C++XsV l4Mg== X-Gm-Message-State: AHYfb5i8lOd2NU1wU+kVAKcLeF4mKWy+CrZc91kYUzCdkkjNd8Gl6zz/ nhi7mSV38iOjowQwfHU+ig== X-Received: by 10.25.18.151 with SMTP id 23mr6046549lfs.95.1502563432378; Sat, 12 Aug 2017 11:43:52 -0700 (PDT) Received: from fabina.bredbandsbolaget.se (c-277e71d5.014-348-6c756e10.cust.bredbandsbolaget.se. [213.113.126.39]) by smtp.gmail.com with ESMTPSA id d64sm696628lfg.22.2017.08.12.11.43.50 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Sat, 12 Aug 2017 11:43:50 -0700 (PDT) From: Linus Walleij To: Wim Van Sebroeck , Guenter Roeck , Jonas Jensen , Andrew Jeffery , Joel Stanley Cc: linux-arm-kernel@lists.infradead.org, linux-watchdog@vger.kernel.org, Linus Walleij Subject: [PATCH 10/11] ARM: dts: fix PCLK name on Gemini and MOXA ART Date: Sat, 12 Aug 2017 20:43:17 +0200 Message-Id: <20170812184318.10144-11-linus.walleij@linaro.org> X-Mailer: git-send-email 2.13.4 In-Reply-To: <20170812184318.10144-1-linus.walleij@linaro.org> References: <20170812184318.10144-1-linus.walleij@linaro.org> Sender: linux-watchdog-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-watchdog@vger.kernel.org These platforms provide a clock to their watchdog, in each case this is the peripheral clock (PCLK), so explicitly name the clock in the device tree. Take this opportunity to add the "faraday,ftwdt010" compatible as fallback to the watchdog IP blocks. Signed-off-by: Linus Walleij --- arch/arm/boot/dts/gemini.dtsi | 3 ++- arch/arm/boot/dts/moxart.dtsi | 3 ++- 2 files changed, 4 insertions(+), 2 deletions(-) -- 2.13.4 -- To unsubscribe from this list: send the line "unsubscribe linux-watchdog" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html diff --git a/arch/arm/boot/dts/gemini.dtsi b/arch/arm/boot/dts/gemini.dtsi index c68e8d430234..f0d178c77153 100644 --- a/arch/arm/boot/dts/gemini.dtsi +++ b/arch/arm/boot/dts/gemini.dtsi @@ -145,11 +145,12 @@ }; watchdog@41000000 { - compatible = "cortina,gemini-watchdog"; + compatible = "cortina,gemini-watchdog", "faraday,ftwdt010"; reg = <0x41000000 0x1000>; interrupts = <3 IRQ_TYPE_LEVEL_HIGH>; resets = <&syscon GEMINI_RESET_WDOG>; clocks = <&syscon GEMINI_CLK_APB>; + clock-names = "PCLK"; }; uart0: serial@42000000 { diff --git a/arch/arm/boot/dts/moxart.dtsi b/arch/arm/boot/dts/moxart.dtsi index 1f4c795d3f72..da7b3237bfe9 100644 --- a/arch/arm/boot/dts/moxart.dtsi +++ b/arch/arm/boot/dts/moxart.dtsi @@ -87,9 +87,10 @@ }; watchdog: watchdog@98500000 { - compatible = "moxa,moxart-watchdog"; + compatible = "moxa,moxart-watchdog", "faraday,ftwdt010"; reg = <0x98500000 0x10>; clocks = <&clk_apb>; + clock-names = "PCLK"; }; sdhci: sdhci@98e00000 { From patchwork Sat Aug 12 18:43:18 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Linus Walleij X-Patchwork-Id: 109941 Delivered-To: patch@linaro.org Received: by 10.140.95.78 with SMTP id h72csp2442590qge; Sat, 12 Aug 2017 11:43:57 -0700 (PDT) X-Received: by 10.84.231.199 with SMTP id g7mr22327836pln.258.1502563437121; Sat, 12 Aug 2017 11:43:57 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1502563437; cv=none; d=google.com; s=arc-20160816; b=IBJj6GOzCDCbnIiCcdL148l4vibnMCxUAjLFxMurb9V0kF9rTRy+MWmehU/BVlz64y K2JD/C4xoymnV+5wKRWWqBB0OWB17ncY7/ch5ubcWLJFWFbiHcSiY/KuR6BljJ1D1jGu D7OhXJj5zShHft09/sxkWvbBXIoNAAH0OnUd6NmR692Hl/hbD1v+MHHS6cNyrEfZonOm WGFAvO466mda73dO7/Ibk5//S4IQlqkXZT1dxYOfoCIfeTpU+MRG9YIZlZAeaBb91hyx en982t4YXxYTZ9Vj7exE94yI38KDOHVFpP/s306YtKTMzTQBDIN7GKp5H++bonfGHpXB 7h/A== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:references:in-reply-to:message-id:date :subject:cc:to:from:dkim-signature:arc-authentication-results; bh=obVfdbW0teM/l7d2m83i9BLTbWep+31PZGsLajEXv1s=; b=D/qx9wykZaQ6AXBE47G4vE8hOjk3QERa/f2WOiSLhmcQqEE7/3TIfOHEstv/N/BkUZ UanZoehMJMUhCslRcH/z7gVPQn7oRkKk5D/5HkdFiZnv0zfZW2O9fSMUnFwnjBPXrWVf kEwxSMvfzpWcSDVyQbgNFVwjzj/XrH97E+QU6hL4JZXemherpTAQdphFEqMtpuS9s2J0 PuJMiLpMkEcveAkBwHZwKkNb8p5qeYO/J1vnJuo9LXQXblmI+TfHIs1IAih+8rppqrXl ecDD3ikeG06YQjQOs6zOccZCIbOzD/UfK3GLaD/O0a00tsk3MxJGTc6A4RYRUl2tG0ym +ggA== ARC-Authentication-Results: i=1; mx.google.com; dkim=neutral (body hash did not verify) header.i=@linaro.org header.s=google header.b=XjKhNsP8; spf=pass (google.com: best guess record for domain of linux-watchdog-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-watchdog-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id p24si2288117pli.501.2017.08.12.11.43.57 for ; Sat, 12 Aug 2017 11:43:57 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-watchdog-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=neutral (body hash did not verify) header.i=@linaro.org header.s=google header.b=XjKhNsP8; spf=pass (google.com: best guess record for domain of linux-watchdog-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-watchdog-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751780AbdHLSn4 (ORCPT ); Sat, 12 Aug 2017 14:43:56 -0400 Received: from mail-lf0-f52.google.com ([209.85.215.52]:33650 "EHLO mail-lf0-f52.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751694AbdHLSn4 (ORCPT ); Sat, 12 Aug 2017 14:43:56 -0400 Received: by mail-lf0-f52.google.com with SMTP id d17so27047316lfe.0 for ; Sat, 12 Aug 2017 11:43:55 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=AEKQ5bWqotYf1IUON+xyvNXItiaOch0LEt8jieKiSxo=; b=XjKhNsP8UvA/GK6eMZHSVtY6tY5bAX+paBgkPd60goltmV01sDYOo2hRY1J/SiV/Ev DUZl9k2ZwtkfSilfBv+Rfoft26g4dYQ5jTolGOkkZZ7cf2OxhoKb8a0HAeolCWsgOkB7 uIGdSclLxo+ILpM3NiVUz/AfyIjAGtR9gfTLY= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=AEKQ5bWqotYf1IUON+xyvNXItiaOch0LEt8jieKiSxo=; b=tdv8GrwpSyPsA71bzT4e9pzXpDmMF6suyEXlR0dboXdzWQLtj2C74HpSa25399OMH7 YRCSSe04wp5+HOuDkY2WUIZFjcweKoXxK6G/D374UUwBARF3U2DnX8+DItdpO3VMvEAc ghCnMZX0OBGcTzLXneyVvz4GH7i8FdrJBCK96WAkNz94B5Co5I9Y3/gKmgU+rMab+Pzh +k9CfVq+3ZzudVfmgiT8hN++dugVg6BJDtCJdccmX1vR6OZ+k0pIsvr0RWRzZaniCi2p Uk/lIz8uUX7x+skM4rUyrYqMY+IAdmKoXl5dqrxkHATn1JF1dSeb+jStQqr1cdfnp2Za re6A== X-Gm-Message-State: AHYfb5hjkLqHSExvUgukpe4SO44DsJt1PeH5ZuZ1A4IwBr9aQfehg/Tc j3DjMOaPg4b/jkOk X-Received: by 10.25.17.218 with SMTP id 87mr7080520lfr.129.1502563434947; Sat, 12 Aug 2017 11:43:54 -0700 (PDT) Received: from fabina.bredbandsbolaget.se (c-277e71d5.014-348-6c756e10.cust.bredbandsbolaget.se. [213.113.126.39]) by smtp.gmail.com with ESMTPSA id d64sm696628lfg.22.2017.08.12.11.43.53 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Sat, 12 Aug 2017 11:43:53 -0700 (PDT) From: Linus Walleij To: Wim Van Sebroeck , Guenter Roeck , Jonas Jensen , Andrew Jeffery , Joel Stanley Cc: linux-arm-kernel@lists.infradead.org, linux-watchdog@vger.kernel.org, Linus Walleij Subject: [PATCH 11/11] ARM: dts: Add PCLK to the Aspeed watchdogs Date: Sat, 12 Aug 2017 20:43:18 +0200 Message-Id: <20170812184318.10144-12-linus.walleij@linaro.org> X-Mailer: git-send-email 2.13.4 In-Reply-To: <20170812184318.10144-1-linus.walleij@linaro.org> References: <20170812184318.10144-1-linus.walleij@linaro.org> Sender: linux-watchdog-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-watchdog@vger.kernel.org This adds the PCLK clock to the Aspeed watchdog blocks. I am not directly familiar with the Aspeed clocking, but since the IP is derived from Faraday FTWDT010 it probably has the ability to run the watchdog on the PCLK if desired so to obtain the frequency from it, it needs to be present in the device tree, and for completeness the PCLK should also be referenced and enabled anyways. Take this opportunity to add the "faraday,ftwdt010" compatible as fallback to the watchdog IP blocks. Signed-off-by: Linus Walleij --- arch/arm/boot/dts/aspeed-g4.dtsi | 7 +++++-- arch/arm/boot/dts/aspeed-g5.dtsi | 12 +++++++++--- 2 files changed, 14 insertions(+), 5 deletions(-) -- 2.13.4 -- To unsubscribe from this list: send the line "unsubscribe linux-watchdog" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html diff --git a/arch/arm/boot/dts/aspeed-g4.dtsi b/arch/arm/boot/dts/aspeed-g4.dtsi index 8a04c7e2d818..23b100383c15 100644 --- a/arch/arm/boot/dts/aspeed-g4.dtsi +++ b/arch/arm/boot/dts/aspeed-g4.dtsi @@ -895,16 +895,19 @@ }; wdt1: wdt@1e785000 { - compatible = "aspeed,ast2400-wdt"; + compatible = "aspeed,ast2400-wdt", "faraday,ftwdt010"; reg = <0x1e785000 0x1c>; interrupts = <27>; + clocks = <&clk_apb>; + clock-names = "PCLK"; }; wdt2: wdt@1e785020 { - compatible = "aspeed,ast2400-wdt"; + compatible = "aspeed,ast2400-wdt", "faraday,ftwdt010"; reg = <0x1e785020 0x1c>; interrupts = <27>; clocks = <&clk_apb>; + clock-names = "PCLK"; status = "disabled"; }; diff --git a/arch/arm/boot/dts/aspeed-g5.dtsi b/arch/arm/boot/dts/aspeed-g5.dtsi index 9cffe347b828..2322d72cd8a9 100644 --- a/arch/arm/boot/dts/aspeed-g5.dtsi +++ b/arch/arm/boot/dts/aspeed-g5.dtsi @@ -1003,21 +1003,27 @@ wdt1: wdt@1e785000 { - compatible = "aspeed,ast2500-wdt"; + compatible = "aspeed,ast2500-wdt", "faraday,ftwdt010"; reg = <0x1e785000 0x20>; interrupts = <27>; + clocks = <&clk_apb>; + clock-names = "PCLK"; }; wdt2: wdt@1e785020 { - compatible = "aspeed,ast2500-wdt"; + compatible = "aspeed,ast2500-wdt", "faraday,ftwdt010"; reg = <0x1e785020 0x20>; interrupts = <27>; + clocks = <&clk_apb>; + clock-names = "PCLK"; status = "disabled"; }; wdt3: wdt@1e785040 { - compatible = "aspeed,ast2500-wdt"; + compatible = "aspeed,ast2500-wdt", "faraday,ftwdt010"; reg = <0x1e785040 0x20>; + clocks = <&clk_apb>; + clock-names = "PCLK"; status = "disabled"; };