From patchwork Thu May 27 10:01:18 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Eugen Hristev X-Patchwork-Id: 449275 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-16.5 required=3.0 tests=BAYES_00,DKIM_INVALID, DKIM_SIGNED, HEADER_FROM_DIFFERENT_DOMAINS, INCLUDES_CR_TRAILER, INCLUDES_PATCH, MAILING_LIST_MULTI, SPF_HELO_NONE, SPF_PASS, URIBL_BLOCKED, USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 0F5BAC47089 for ; Thu, 27 May 2021 10:01:50 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id D1F61610A6 for ; Thu, 27 May 2021 10:01:49 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S235966AbhE0KDV (ORCPT ); Thu, 27 May 2021 06:03:21 -0400 Received: from esa.microchip.iphmx.com ([68.232.153.233]:14430 "EHLO esa.microchip.iphmx.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S236031AbhE0KDU (ORCPT ); Thu, 27 May 2021 06:03:20 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=microchip.com; i=@microchip.com; q=dns/txt; s=mchp; t=1622109708; x=1653645708; h=from:to:cc:subject:date:message-id:mime-version: content-transfer-encoding; bh=yz80Hjo1XW+O2NjLkpyn0DsjcDlcfjnTODrJ9v4dQc4=; b=maiLJiUXpryT8l/osw1Zd9ZTUMh0YjstHLHEOr4T9GfMZdLxX6Am5sub axXoLzh/+vDyw9uZPt6OMR9s2GY2D2eLDplkgHk7geZRFLowpbtfJaayT o/kMaDP3vasPtH5iYrdpEhvRsdocoMa8BP310Y0mGfxRUM+HehgUikNCp MAnrJBsE8Qdn6tAFKkpCVfIJvsdoTz2IpHGwv7YtQ6G7SOL7okr4m7xxb Z/9dxdJztbX3hkh94MY9ZVZYLedOyg4ToYb9L+sWfqjOQ0epo2MeRzL3Y ey+N90xYgo6yIT/OM57cT6bz7oiaHX2yVQKLNtyLhFZU1FrJj0WgERUfw g==; IronPort-SDR: xxAs3LFHSKUQ6WoGduLNiFpckRc7SX2DtA7ZF2OUkAfKKGgfIfPGQylxJXdegD3EpOTonW8h19 Fj6BwYzkSpDjt5BYkt+utScK+7+XAMy97UvVud0vk9URma0VIKBWD0vlz1zA8x2Ba/wDPKQJSf 5L+JOZUHqQCWQkP7O/qmZl3/tlPdmgZ17rmyzdgiDKiKjb+OCT6cwWQcifqr434bP8UJUNvTDJ cDkQd99cr3YonTCKRqn+vRbERc7UPIOYwLQKJiKH9F8mdpKC8qWk2F7uFjEG1io84om73XZYaf N+k= X-IronPort-AV: E=Sophos;i="5.82,334,1613458800"; d="scan'208";a="129696694" Received: from smtpout.microchip.com (HELO email.microchip.com) ([198.175.253.82]) by esa1.microchip.iphmx.com with ESMTP/TLS/AES256-SHA256; 27 May 2021 03:01:46 -0700 Received: from chn-vm-ex02.mchp-main.com (10.10.85.144) by chn-vm-ex04.mchp-main.com (10.10.85.152) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2176.2; Thu, 27 May 2021 03:01:46 -0700 Received: from ROB-ULT-M18282.microchip.com (10.10.115.15) by chn-vm-ex02.mchp-main.com (10.10.85.144) with Microsoft SMTP Server id 15.1.2176.2 via Frontend Transport; Thu, 27 May 2021 03:01:33 -0700 From: Eugen Hristev To: , , CC: , , , , , Eugen Hristev Subject: [PATCH 1/3] dt-bindings: watchdog: sama5d4-wdt: convert to yaml Date: Thu, 27 May 2021 13:01:18 +0300 Message-ID: <20210527100120.266796-1-eugen.hristev@microchip.com> X-Mailer: git-send-email 2.25.1 MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: linux-watchdog@vger.kernel.org Convert the old txt binding to yaml format. Signed-off-by: Eugen Hristev Reviewed-by: Rob Herring --- .../bindings/watchdog/atmel,sama5d4-wdt.yaml | 73 +++++++++++++++++++ .../bindings/watchdog/atmel-sama5d4-wdt.txt | 34 --------- 2 files changed, 73 insertions(+), 34 deletions(-) create mode 100644 Documentation/devicetree/bindings/watchdog/atmel,sama5d4-wdt.yaml delete mode 100644 Documentation/devicetree/bindings/watchdog/atmel-sama5d4-wdt.txt diff --git a/Documentation/devicetree/bindings/watchdog/atmel,sama5d4-wdt.yaml b/Documentation/devicetree/bindings/watchdog/atmel,sama5d4-wdt.yaml new file mode 100644 index 000000000000..0d0ab81da040 --- /dev/null +++ b/Documentation/devicetree/bindings/watchdog/atmel,sama5d4-wdt.yaml @@ -0,0 +1,73 @@ +# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause) +%YAML 1.2 +--- +$id: http://devicetree.org/schemas/watchdog/atmel,sama5d4-wdt.yaml# +$schema: http://devicetree.org/meta-schemas/core.yaml# + +title: Atmel SAMA5D4 Watchdog Timer (WDT) Controller + +maintainers: + - Eugen Hristev + +allOf: + - $ref: "watchdog.yaml#" + +properties: + compatible: + enum: + - atmel,sama5d4-wdt + - microchip,sam9x60-wdt + + reg: + maxItems: 1 + + atmel,watchdog-type: + $ref: /schemas/types.yaml#/definitions/string + description: should be hardware or software. + oneOf: + - description: + Enable watchdog fault reset. A watchdog fault triggers + watchdog reset. + const: hardware + - description: + Enable watchdog fault interrupt. A watchdog fault asserts + watchdog interrupt. + const: software + default: hardware + + atmel,idle-halt: + $ref: /schemas/types.yaml#/definitions/flag + description: | + present if you want to stop the watchdog when the CPU is in idle state. + CAUTION: This property should be used with care, it actually makes the + watchdog not counting when the CPU is in idle state, therefore the + watchdog reset time depends on mean CPU usage and will not reset at all + if the CPU stop working while it is in idle state, which is probably + not what you want. + + atmel,dbg-halt: + $ref: /schemas/types.yaml#/definitions/flag + description: | + present if you want to stop the watchdog when the CPU is in debug state. + +required: + - compatible + - reg + +unevaluatedProperties: false + +examples: + - | + #include + + watchdog@fc068640 { + compatible = "atmel,sama5d4-wdt"; + reg = <0xfc068640 0x10>; + interrupts = <4 IRQ_TYPE_LEVEL_HIGH 5>; + timeout-sec = <10>; + atmel,watchdog-type = "hardware"; + atmel,dbg-halt; + atmel,idle-halt; + }; + +... diff --git a/Documentation/devicetree/bindings/watchdog/atmel-sama5d4-wdt.txt b/Documentation/devicetree/bindings/watchdog/atmel-sama5d4-wdt.txt deleted file mode 100644 index 44727fcc2729..000000000000 --- a/Documentation/devicetree/bindings/watchdog/atmel-sama5d4-wdt.txt +++ /dev/null @@ -1,34 +0,0 @@ -* Atmel SAMA5D4 Watchdog Timer (WDT) Controller - -Required properties: -- compatible: "atmel,sama5d4-wdt" or "microchip,sam9x60-wdt" -- reg: base physical address and length of memory mapped region. - -Optional properties: -- timeout-sec: watchdog timeout value (in seconds). -- interrupts: interrupt number to the CPU. -- atmel,watchdog-type: should be "hardware" or "software". - "hardware": enable watchdog fault reset. A watchdog fault triggers - watchdog reset. - "software": enable watchdog fault interrupt. A watchdog fault asserts - watchdog interrupt. -- atmel,idle-halt: present if you want to stop the watchdog when the CPU is - in idle state. - CAUTION: This property should be used with care, it actually makes the - watchdog not counting when the CPU is in idle state, therefore the - watchdog reset time depends on mean CPU usage and will not reset at all - if the CPU stop working while it is in idle state, which is probably - not what you want. -- atmel,dbg-halt: present if you want to stop the watchdog when the CPU is - in debug state. - -Example: - watchdog@fc068640 { - compatible = "atmel,sama5d4-wdt"; - reg = <0xfc068640 0x10>; - interrupts = <4 IRQ_TYPE_LEVEL_HIGH 5>; - timeout-sec = <10>; - atmel,watchdog-type = "hardware"; - atmel,dbg-halt; - atmel,idle-halt; - }; From patchwork Thu May 27 10:01:19 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Eugen Hristev X-Patchwork-Id: 449842 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-16.6 required=3.0 tests=BAYES_00,DKIM_INVALID, DKIM_SIGNED, HEADER_FROM_DIFFERENT_DOMAINS, INCLUDES_CR_TRAILER, INCLUDES_PATCH, MAILING_LIST_MULTI, SPF_HELO_NONE, SPF_PASS, USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id D7140C47089 for ; Thu, 27 May 2021 10:01:52 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id B41E36124C for ; Thu, 27 May 2021 10:01:52 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S236031AbhE0KDX (ORCPT ); Thu, 27 May 2021 06:03:23 -0400 Received: from esa.microchip.iphmx.com ([68.232.153.233]:50144 "EHLO esa.microchip.iphmx.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S236042AbhE0KDX (ORCPT ); Thu, 27 May 2021 06:03:23 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=microchip.com; i=@microchip.com; q=dns/txt; s=mchp; t=1622109710; x=1653645710; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=jAo598UZNKi+UDMf4kevfiZHzfajlsdU+s2V++1FMJM=; b=jg7pkd/TE6AnRKpjCepu8i9JKXDUmQWOpVYEc3QlmRiWg3tZTI1rvMOK DEltWCYqhSC0anjGhdSnY//S1mclE5+EdycTWQfbVcJOpYNRC2+D6yGMT 0px4idF1ne980kW/epYmJzQ/+gbGWc04VAuW4dcGneu8iG7uSk9Gk8jIe pE8OK7U88ErRia2U50+EDObCgPUIUl+O5uQ+gZB5ELVWmgH7XoctdG0gb WXjk84c7/9aeFHy7dXrvniF8VFmQznLqMHBiUBrDNfRRFA762efWp5Ej8 Lo83En2vqOTHs7ge4ASPIuFIq04CeEpVgVrAa8Bw8XOWJGss7DiRkiONh A==; IronPort-SDR: AC7yltpeuijXrHzTqhXoh6RV0Bfrk6pjN1QbwTXo0+M50hmVbbtrpZ6YnHhgR/yU4siFvZtEHO 4m5nTAHetJxFvYpzjyzWtcF/sTrVpyyxHmo6fUBumYFPb2jBrVkrHqfnHFNR9i3GoiotPAAIHb pk2ATntMZfifDRmI9IaxBpzpRcaWf6iAXCbju85vEA7yrtLrywIvUqtz46GXsmiKoD9/qoHCoO ZA5QY33G1Tou+CVKPXL+muIWJgC3A2zeK8yT4LajY8kgj8xHhRxHB0aljry3IbatB2oxhUFahK 9Dk= X-IronPort-AV: E=Sophos;i="5.82,334,1613458800"; d="scan'208";a="123151626" Received: from smtpout.microchip.com (HELO email.microchip.com) ([198.175.253.82]) by esa3.microchip.iphmx.com with ESMTP/TLS/AES256-SHA256; 27 May 2021 03:01:49 -0700 Received: from chn-vm-ex02.mchp-main.com (10.10.85.144) by chn-vm-ex01.mchp-main.com (10.10.85.143) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2176.2; Thu, 27 May 2021 03:01:49 -0700 Received: from ROB-ULT-M18282.microchip.com (10.10.115.15) by chn-vm-ex02.mchp-main.com (10.10.85.144) with Microsoft SMTP Server id 15.1.2176.2 via Frontend Transport; Thu, 27 May 2021 03:01:46 -0700 From: Eugen Hristev To: , , CC: , , , , , Eugen Hristev Subject: [PATCH 2/3] watchdog: sama5d4_wdt: add support for sama7g5-wdt Date: Thu, 27 May 2021 13:01:19 +0300 Message-ID: <20210527100120.266796-2-eugen.hristev@microchip.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20210527100120.266796-1-eugen.hristev@microchip.com> References: <20210527100120.266796-1-eugen.hristev@microchip.com> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: linux-watchdog@vger.kernel.org Add support for compatible sama7g5-wdt. The sama7g5 wdt is the same hardware block as on sam9x60. Adapt the driver to use the sam9x60/sama7g5 variant if either of the two compatibles are selected (sam9x60-wdt/sama7g5-wdt). Signed-off-by: Eugen Hristev --- drivers/watchdog/sama5d4_wdt.c | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/drivers/watchdog/sama5d4_wdt.c b/drivers/watchdog/sama5d4_wdt.c index e5d11d6a2600..ec20ad4e534f 100644 --- a/drivers/watchdog/sama5d4_wdt.c +++ b/drivers/watchdog/sama5d4_wdt.c @@ -268,8 +268,10 @@ static int sama5d4_wdt_probe(struct platform_device *pdev) wdd->min_timeout = MIN_WDT_TIMEOUT; wdd->max_timeout = MAX_WDT_TIMEOUT; wdt->last_ping = jiffies; - wdt->sam9x60_support = of_device_is_compatible(dev->of_node, - "microchip,sam9x60-wdt"); + + if (of_device_is_compatible(dev->of_node, "microchip,sam9x60-wdt") || + of_device_is_compatible(dev->of_node, "microchip,sama7g5-wdt")) + wdt->sam9x60_support = true; watchdog_set_drvdata(wdd, wdt); @@ -329,6 +331,10 @@ static const struct of_device_id sama5d4_wdt_of_match[] = { { .compatible = "microchip,sam9x60-wdt", }, + { + .compatible = "microchip,sama7g5-wdt", + }, + { } }; MODULE_DEVICE_TABLE(of, sama5d4_wdt_of_match); From patchwork Thu May 27 10:01:20 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Eugen Hristev X-Patchwork-Id: 449274 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-16.6 required=3.0 tests=BAYES_00,DKIM_INVALID, DKIM_SIGNED, HEADER_FROM_DIFFERENT_DOMAINS, INCLUDES_CR_TRAILER, INCLUDES_PATCH, MAILING_LIST_MULTI, SPF_HELO_NONE, SPF_PASS, USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 01917C47089 for ; Thu, 27 May 2021 10:02:07 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id D2976613D3 for ; Thu, 27 May 2021 10:02:06 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S236073AbhE0KDh (ORCPT ); Thu, 27 May 2021 06:03:37 -0400 Received: from esa.microchip.iphmx.com ([68.232.154.123]:64945 "EHLO esa.microchip.iphmx.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S236071AbhE0KDa (ORCPT ); Thu, 27 May 2021 06:03:30 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=microchip.com; i=@microchip.com; q=dns/txt; s=mchp; t=1622109717; x=1653645717; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=NHC7O/pOqdLxXD582td2chdxDt8JFmxVEAYC1qsDiec=; b=hlw3ltutZJqMeGeCImyu4JuTkASyBN/LoTIm1qB37KjLJAok+nbQ8Ixr uthKjE1vH73v6dC5At8j//5s5tHWE8xo8k6Pp3ScgBvSAon0f4vmHfRUT SMHspN8W/zvYwwBTYqrtppwQuFtKe/9SbRfXu8cOZXNdoN7gqRfPcyJ7Z LLbmSLV2r7Jd+4yoyfLL5agj6YIU5LQlqEBj9sFmp9M6GkObUPI89wYWJ f3e2E0C2p+N9e1uMdEHRIP9bkEQUxewgO3KGX879+xJ6EmmYnhYQhZkF4 Fxs6VqD7hANqTDfUuKFS71CWTWF0FomUou6Xna81TsuFq5BD1vcg+2/yD A==; IronPort-SDR: HoyDt9JX0VCmKZZHh0afcs5zD3TN+Axb5Z48rdJuRlNdiCQcbhTV/vyZYdFYGusVwcBx/TthGw FGh6G5LrlrjpIA8o+fv/flqEWdsG7zZWBWSsrVnK4/3ySsbrh9N0h3jLpBqVb97c16M5mL1YKm bJxZ4SzXFPX3XI+i26ITwVyqd0uNitBDk6hmoV8OhV47xvkeoZM4F2Aw89luhLfEvuNVJuQxN+ VOtuGoiNXtggRUpci/ae6P9F7gWCQpe+ZZK7xTLwX9yeCi1YgseZKSehk9YxvQgC3KXZwMHR2j pPU= X-IronPort-AV: E=Sophos;i="5.82,334,1613458800"; d="scan'208";a="119361978" Received: from smtpout.microchip.com (HELO email.microchip.com) ([198.175.253.82]) by esa2.microchip.iphmx.com with ESMTP/TLS/AES256-SHA256; 27 May 2021 03:01:56 -0700 Received: from chn-vm-ex02.mchp-main.com (10.10.85.144) by chn-vm-ex04.mchp-main.com (10.10.85.152) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2176.2; Thu, 27 May 2021 03:01:55 -0700 Received: from ROB-ULT-M18282.microchip.com (10.10.115.15) by chn-vm-ex02.mchp-main.com (10.10.85.144) with Microsoft SMTP Server id 15.1.2176.2 via Frontend Transport; Thu, 27 May 2021 03:01:49 -0700 From: Eugen Hristev To: , , CC: , , , , , Eugen Hristev Subject: [PATCH 3/3] dt-bindings: watchdog: sama5d4-wdt: add compatible for sama7g5-wdt Date: Thu, 27 May 2021 13:01:20 +0300 Message-ID: <20210527100120.266796-3-eugen.hristev@microchip.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20210527100120.266796-1-eugen.hristev@microchip.com> References: <20210527100120.266796-1-eugen.hristev@microchip.com> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: linux-watchdog@vger.kernel.org This driver is also compatible with the watchdog on sama7g5 SoC. Add the corresponding compatible string to the binding. Signed-off-by: Eugen Hristev Reviewed-by: Rob Herring --- .../devicetree/bindings/watchdog/atmel,sama5d4-wdt.yaml | 1 + 1 file changed, 1 insertion(+) diff --git a/Documentation/devicetree/bindings/watchdog/atmel,sama5d4-wdt.yaml b/Documentation/devicetree/bindings/watchdog/atmel,sama5d4-wdt.yaml index 0d0ab81da040..9856cd76c28d 100644 --- a/Documentation/devicetree/bindings/watchdog/atmel,sama5d4-wdt.yaml +++ b/Documentation/devicetree/bindings/watchdog/atmel,sama5d4-wdt.yaml @@ -17,6 +17,7 @@ properties: enum: - atmel,sama5d4-wdt - microchip,sam9x60-wdt + - microchip,sama7g5-wdt reg: maxItems: 1