From patchwork Sun May 12 10:10:30 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Anson Huang X-Patchwork-Id: 10939983 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id AFB8B1398 for ; Sun, 12 May 2019 10:10:37 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 944D7237A5 for ; Sun, 12 May 2019 10:10:37 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 857F526246; Sun, 12 May 2019 10:10:37 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-8.0 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,MAILING_LIST_MULTI,RCVD_IN_DNSWL_HI autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 11B04237A5 for ; Sun, 12 May 2019 10:10:36 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726143AbfELKKg (ORCPT ); Sun, 12 May 2019 06:10:36 -0400 Received: from mail-eopbgr130049.outbound.protection.outlook.com ([40.107.13.49]:42360 "EHLO EUR01-HE1-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1725934AbfELKKg (ORCPT ); Sun, 12 May 2019 06:10:36 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=nxp.com; s=selector2; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=NfV7o7qB+GSQeZRyq9facVc0aNh6wxwa807rtSeVd40=; b=RP+XPM+S88LyCEaFntBsxUIiPdKh35ETKvFU8SyBUHgPFw6WE82ne6SCNEFQyu0XUKfXhstB1bQl5qL9bkPnh9daJoYOfPM1ZtqBcE9yeURUvG1OcUyJcpqtQv4zQxDqGuKPYuuElT1qMIlEX+bW+9m6ta5eil+MJ/uj0ILhILI= Received: from DB3PR0402MB3916.eurprd04.prod.outlook.com (52.134.72.18) by DB3PR0402MB3913.eurprd04.prod.outlook.com (52.134.65.143) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.1878.21; Sun, 12 May 2019 10:10:30 +0000 Received: from DB3PR0402MB3916.eurprd04.prod.outlook.com ([fe80::d035:3bd0:a56a:189d]) by DB3PR0402MB3916.eurprd04.prod.outlook.com ([fe80::d035:3bd0:a56a:189d%2]) with mapi id 15.20.1878.022; Sun, 12 May 2019 10:10:30 +0000 From: Anson Huang To: "robh+dt@kernel.org" , "mark.rutland@arm.com" , "wim@linux-watchdog.org" , "linux@roeck-us.net" , "shawnguo@kernel.org" , "s.hauer@pengutronix.de" , "kernel@pengutronix.de" , "festevam@gmail.com" , Aisheng Dong , "ulf.hansson@linaro.org" , Daniel Baluta , Peng Fan , "devicetree@vger.kernel.org" , "linux-kernel@vger.kernel.org" , "linux-watchdog@vger.kernel.org" , "linux-arm-kernel@lists.infradead.org" CC: dl-linux-imx Subject: [PATCH RESEND V4 1/3] dt-bindings: watchdog: move i.MX system controller watchdog binding to SCU Thread-Topic: [PATCH RESEND V4 1/3] dt-bindings: watchdog: move i.MX system controller watchdog binding to SCU Thread-Index: AQHVCKrtAYPvRNqPfE2cK0k7Czo+1A== Date: Sun, 12 May 2019 10:10:30 +0000 Message-ID: <1557655528-12816-1-git-send-email-Anson.Huang@nxp.com> Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-mailer: git-send-email 2.7.4 x-clientproxiedby: HK0P153CA0036.APCP153.PROD.OUTLOOK.COM (2603:1096:203:17::24) To DB3PR0402MB3916.eurprd04.prod.outlook.com (2603:10a6:8:10::18) authentication-results: spf=none (sender IP is ) smtp.mailfrom=anson.huang@nxp.com; x-ms-exchange-messagesentrepresentingtype: 1 x-originating-ip: [119.31.174.66] x-ms-publictraffictype: Email x-ms-office365-filtering-correlation-id: 8907832a-44cb-4f1a-22fd-08d6d6c2103f x-ms-office365-filtering-ht: Tenant x-microsoft-antispam: BCL:0;PCL:0;RULEID:(2390118)(7020095)(4652040)(8989299)(4534185)(4627221)(201703031133081)(201702281549075)(8990200)(5600141)(711020)(4605104)(4618075)(2017052603328)(7193020);SRVR:DB3PR0402MB3913; x-ms-traffictypediagnostic: DB3PR0402MB3913: x-microsoft-antispam-prvs: x-ms-oob-tlc-oobclassifiers: OLM:7691; x-forefront-prvs: 0035B15214 x-forefront-antispam-report: SFV:NSPM;SFS:(10009020)(136003)(39860400002)(396003)(366004)(346002)(376002)(189003)(199004)(66556008)(66066001)(73956011)(256004)(6512007)(2616005)(66446008)(64756008)(476003)(3846002)(66476007)(14444005)(66946007)(14454004)(6506007)(2201001)(386003)(6116002)(2501003)(102836004)(86362001)(6436002)(478600001)(53936002)(6486002)(71190400001)(26005)(71200400001)(186003)(8676002)(4326008)(99286004)(25786009)(8936002)(81156014)(36756003)(50226002)(81166006)(52116002)(316002)(68736007)(5660300002)(110136005)(7416002)(2906002)(486006)(7736002)(305945005)(921003)(1121003);DIR:OUT;SFP:1101;SCL:1;SRVR:DB3PR0402MB3913;H:DB3PR0402MB3916.eurprd04.prod.outlook.com;FPR:;SPF:None;LANG:en;PTR:InfoNoRecords;MX:1;A:1; received-spf: None (protection.outlook.com: nxp.com does not designate permitted sender hosts) x-ms-exchange-senderadcheck: 1 x-microsoft-antispam-message-info: eg8PZ6ekXyfSgeADL+h824yUK+cb/qEzARQKqvR181pIJgzWwTlTN0MGGLbTajFTDOfUPH5421rtpGd8lTahzIve3c4iprRJYe5jMZOCi/lS1MBUofyTHU1cCTmvvZSWESR44HpcdMIKdRhfq2+7UVNtHdH++N6bRHtFNc9B20pp1iKXpc5CD0HBiEcPS7dl1fMrC3BpJY5OKhhAwhAIDqy53wkjww39GaB5LE2TDdA4SUaWMLATu+CkasZ6rl/Pqg0iX4+o/2lgpjN0hLcxdH4AkUSpk3yBjpJQ5t3V0VRDKzCCDZFjlCmOEY+cSFdD6uVvlzxmA+BNw/ZKhQP7CqsyYsr/DgwSRrPRuj4cVtYOqKP4/urwjsNSeLtMxQqCp2ssAduesyWQkeLGmS+WTNSYyALb1rTp+HcMmCYBtIQ= Content-ID: <4BD8A2D60EC3E14C97C5590BA1ECE00F@eurprd04.prod.outlook.com> MIME-Version: 1.0 X-OriginatorOrg: nxp.com X-MS-Exchange-CrossTenant-Network-Message-Id: 8907832a-44cb-4f1a-22fd-08d6d6c2103f X-MS-Exchange-CrossTenant-originalarrivaltime: 12 May 2019 10:10:30.6037 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: 686ea1d3-bc2b-4c6f-a92c-d99c5c301635 X-MS-Exchange-CrossTenant-mailboxtype: HOSTED X-MS-Exchange-Transport-CrossTenantHeadersStamped: DB3PR0402MB3913 Sender: linux-watchdog-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-watchdog@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP i.MX system controller watchdog depends on SCU driver to support interrupt function, so it needs to be subnode of SCU node in DT, binding doc should be moved to fsl,scu.txt as well. Signed-off-by: Anson Huang Reviewed-by: Rob Herring --- No change, just resend patch with correct encoding. --- .../devicetree/bindings/arm/freescale/fsl,scu.txt | 15 ++++++++++++++ .../bindings/watchdog/fsl-imx-sc-wdt.txt | 24 ---------------------- 2 files changed, 15 insertions(+), 24 deletions(-) delete mode 100644 Documentation/devicetree/bindings/watchdog/fsl-imx-sc-wdt.txt diff --git a/Documentation/devicetree/bindings/arm/freescale/fsl,scu.txt b/Documentation/devicetree/bindings/arm/freescale/fsl,scu.txt index 5d7dbab..1b56557 100644 --- a/Documentation/devicetree/bindings/arm/freescale/fsl,scu.txt +++ b/Documentation/devicetree/bindings/arm/freescale/fsl,scu.txt @@ -133,6 +133,16 @@ RTC bindings based on SCU Message Protocol Required properties: - compatible: should be "fsl,imx8qxp-sc-rtc"; +Watchdog bindings based on SCU Message Protocol +------------------------------------------------------------ + +Required properties: +- compatible: should be: + "fsl,imx8qxp-sc-wdt" + followed by "fsl,imx-sc-wdt"; +Optional properties: +- timeout-sec: contains the watchdog timeout in seconds. + Example (imx8qxp): ------------- aliases { @@ -185,6 +195,11 @@ firmware { rtc: rtc { compatible = "fsl,imx8qxp-sc-rtc"; }; + + watchdog { + compatible = "fsl,imx8qxp-sc-wdt", "fsl,imx-sc-wdt"; + timeout-sec = <60>; + }; }; }; diff --git a/Documentation/devicetree/bindings/watchdog/fsl-imx-sc-wdt.txt b/Documentation/devicetree/bindings/watchdog/fsl-imx-sc-wdt.txt deleted file mode 100644 index 02b87e9..0000000 --- a/Documentation/devicetree/bindings/watchdog/fsl-imx-sc-wdt.txt +++ /dev/null @@ -1,24 +0,0 @@ -* Freescale i.MX System Controller Watchdog - -i.MX system controller watchdog is for i.MX SoCs with system controller inside, -the watchdog is managed by system controller, users can ONLY communicate with -system controller from secure mode for watchdog operations, so Linux i.MX system -controller watchdog driver will call ARM SMC API and trap into ARM-Trusted-Firmware -for watchdog operations, ARM-Trusted-Firmware is running at secure EL3 mode and -it will request system controller to execute the watchdog operation passed from -Linux kernel. - -Required properties: -- compatible: Should be : - "fsl,imx8qxp-sc-wdt" - followed by "fsl,imx-sc-wdt"; - -Optional properties: -- timeout-sec : Contains the watchdog timeout in seconds. - -Examples: - -watchdog { - compatible = "fsl,imx8qxp-sc-wdt", "fsl,imx-sc-wdt"; - timeout-sec = <60>; -}; From patchwork Sun May 12 10:10:35 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Anson Huang X-Patchwork-Id: 10939987 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id ED8E91398 for ; Sun, 12 May 2019 10:10:45 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id DC310237A5 for ; Sun, 12 May 2019 10:10:45 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id D00C326246; Sun, 12 May 2019 10:10:45 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-8.0 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,MAILING_LIST_MULTI,RCVD_IN_DNSWL_HI autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 809BB237A5 for ; Sun, 12 May 2019 10:10:45 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726542AbfELKKk (ORCPT ); Sun, 12 May 2019 06:10:40 -0400 Received: from mail-eopbgr130082.outbound.protection.outlook.com ([40.107.13.82]:7936 "EHLO EUR01-HE1-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1725934AbfELKKj (ORCPT ); Sun, 12 May 2019 06:10:39 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=nxp.com; s=selector2; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=T3AGc1aLTArImRJodXIF4c+v04Nk6tBX7o1s2UZoggY=; b=UBkdP63wtIObE7QLYO+H7EnJuUYsoeD1et0b446PLnKqWmuqFjD6wDXWE7BubWHC75amwOEMP8uqBIHGu7QHUrp1+x42fsZiSP6Np2HD1wsBnXvrwB0kU66o1toCRKssgJWgYDwimOaOXPgULSkuHxjYg52bagEfCqzW3u7xgyU= Received: from DB3PR0402MB3916.eurprd04.prod.outlook.com (52.134.72.18) by DB3PR0402MB3913.eurprd04.prod.outlook.com (52.134.65.143) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.1878.21; Sun, 12 May 2019 10:10:36 +0000 Received: from DB3PR0402MB3916.eurprd04.prod.outlook.com ([fe80::d035:3bd0:a56a:189d]) by DB3PR0402MB3916.eurprd04.prod.outlook.com ([fe80::d035:3bd0:a56a:189d%2]) with mapi id 15.20.1878.022; Sun, 12 May 2019 10:10:35 +0000 From: Anson Huang To: "robh+dt@kernel.org" , "mark.rutland@arm.com" , "wim@linux-watchdog.org" , "linux@roeck-us.net" , "shawnguo@kernel.org" , "s.hauer@pengutronix.de" , "kernel@pengutronix.de" , "festevam@gmail.com" , Aisheng Dong , "ulf.hansson@linaro.org" , Daniel Baluta , Peng Fan , "devicetree@vger.kernel.org" , "linux-kernel@vger.kernel.org" , "linux-watchdog@vger.kernel.org" , "linux-arm-kernel@lists.infradead.org" CC: dl-linux-imx Subject: [PATCH RESEND V4 2/3] arm64: dts: imx8qxp: Move watchdog node into scu node Thread-Topic: [PATCH RESEND V4 2/3] arm64: dts: imx8qxp: Move watchdog node into scu node Thread-Index: AQHVCKrxek0Xatu7SEyE08ZoyZ0h7A== Date: Sun, 12 May 2019 10:10:35 +0000 Message-ID: <1557655528-12816-2-git-send-email-Anson.Huang@nxp.com> References: <1557655528-12816-1-git-send-email-Anson.Huang@nxp.com> In-Reply-To: <1557655528-12816-1-git-send-email-Anson.Huang@nxp.com> Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-mailer: git-send-email 2.7.4 x-clientproxiedby: HK0P153CA0036.APCP153.PROD.OUTLOOK.COM (2603:1096:203:17::24) To DB3PR0402MB3916.eurprd04.prod.outlook.com (2603:10a6:8:10::18) authentication-results: spf=none (sender IP is ) smtp.mailfrom=anson.huang@nxp.com; x-ms-exchange-messagesentrepresentingtype: 1 x-originating-ip: [119.31.174.66] x-ms-publictraffictype: Email x-ms-office365-filtering-correlation-id: 1a9ddf12-e453-489a-97ca-08d6d6c21341 x-ms-office365-filtering-ht: Tenant x-microsoft-antispam: BCL:0;PCL:0;RULEID:(2390118)(7020095)(4652040)(8989299)(4534185)(4627221)(201703031133081)(201702281549075)(8990200)(5600141)(711020)(4605104)(4618075)(2017052603328)(7193020);SRVR:DB3PR0402MB3913; x-ms-traffictypediagnostic: DB3PR0402MB3913: x-microsoft-antispam-prvs: x-ms-oob-tlc-oobclassifiers: OLM:514; x-forefront-prvs: 0035B15214 x-forefront-antispam-report: SFV:NSPM;SFS:(10009020)(136003)(39860400002)(396003)(366004)(346002)(376002)(189003)(199004)(66556008)(11346002)(66066001)(73956011)(256004)(6512007)(2616005)(66446008)(64756008)(476003)(3846002)(66476007)(66946007)(14454004)(6506007)(2201001)(386003)(6116002)(2501003)(102836004)(86362001)(6436002)(478600001)(53936002)(6486002)(71190400001)(26005)(71200400001)(186003)(8676002)(76176011)(4326008)(99286004)(25786009)(8936002)(81156014)(36756003)(446003)(50226002)(81166006)(52116002)(4744005)(316002)(68736007)(5660300002)(110136005)(7416002)(2906002)(486006)(7736002)(305945005)(921003)(32563001)(1121003);DIR:OUT;SFP:1101;SCL:1;SRVR:DB3PR0402MB3913;H:DB3PR0402MB3916.eurprd04.prod.outlook.com;FPR:;SPF:None;LANG:en;PTR:InfoNoRecords;MX:1;A:1; received-spf: None (protection.outlook.com: nxp.com does not designate permitted sender hosts) x-ms-exchange-senderadcheck: 1 x-microsoft-antispam-message-info: d6vQKzi3qW+jsIC9SVaNoz4t7PRweXrDCOnsLJs4AraRTtGGrBuaUyYPWJu+GRCduxxAnFSu5gAB2kDHSVbJ5OX6abGXHkMrRU5kiSn3UhRqsJLSpjaKLUkwxeNDOhqQAmTrSCo/ckTcrWp9bjYQrKPv+3PaOVD2ZSzsQOkOODl0xxtyhZcuh/31TKmMGeossL5CqgxkRyo9CCAnoqi0W1GsVNJz2P5N7JIv027F65+QI0qvvV29vbI5LjM9Qp2itmbwAmGpbVxEERhTRYWlPoGUMa9qE2KZARs9hH0xR2PXvnhXD7vJ047nBxKnt7s+eBUn/V53NSthtdzvDm69ef5owT+GFV3aQQWkZB8NL6iFOMauLNjo0K8ZAnSm7kb1cWC2KtrXF5r6eRKmqTetbXpkXpik9STNkMbgHkN73Cw= Content-ID: <1BEDB087C1756F40B98CCF53E1F492B1@eurprd04.prod.outlook.com> MIME-Version: 1.0 X-OriginatorOrg: nxp.com X-MS-Exchange-CrossTenant-Network-Message-Id: 1a9ddf12-e453-489a-97ca-08d6d6c21341 X-MS-Exchange-CrossTenant-originalarrivaltime: 12 May 2019 10:10:35.8851 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: 686ea1d3-bc2b-4c6f-a92c-d99c5c301635 X-MS-Exchange-CrossTenant-mailboxtype: HOSTED X-MS-Exchange-Transport-CrossTenantHeadersStamped: DB3PR0402MB3913 Sender: linux-watchdog-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-watchdog@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP i.MX system controller watchdog has pretimeout function which depends on i.MX SCU driver, so it should be a subnode of SCU. Signed-off-by: Anson Huang --- No change, just resend patch with correct encoding. --- arch/arm64/boot/dts/freescale/imx8qxp.dtsi | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/arch/arm64/boot/dts/freescale/imx8qxp.dtsi b/arch/arm64/boot/dts/freescale/imx8qxp.dtsi index 0683ee2..b17c22e 100644 --- a/arch/arm64/boot/dts/freescale/imx8qxp.dtsi +++ b/arch/arm64/boot/dts/freescale/imx8qxp.dtsi @@ -149,6 +149,11 @@ rtc: rtc { compatible = "fsl,imx8qxp-sc-rtc"; }; + + watchdog { + compatible = "fsl,imx8qxp-sc-wdt", "fsl,imx-sc-wdt"; + timeout-sec = <60>; + }; }; timer { @@ -517,9 +522,4 @@ power-domains = <&pd IMX_SC_R_GPIO_7>; }; }; - - watchdog { - compatible = "fsl,imx8qxp-sc-wdt", "fsl,imx-sc-wdt"; - timeout-sec = <60>; - }; }; From patchwork Sun May 12 10:10:41 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Anson Huang X-Patchwork-Id: 10939991 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 4091A1390 for ; Sun, 12 May 2019 10:10:53 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 2EA3F237A5 for ; Sun, 12 May 2019 10:10:53 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 22C6026246; Sun, 12 May 2019 10:10:53 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-8.0 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,MAILING_LIST_MULTI,RCVD_IN_DNSWL_HI autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 7D443237A5 for ; Sun, 12 May 2019 10:10:52 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726599AbfELKKq (ORCPT ); Sun, 12 May 2019 06:10:46 -0400 Received: from mail-eopbgr130074.outbound.protection.outlook.com ([40.107.13.74]:51522 "EHLO EUR01-HE1-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1725934AbfELKKq (ORCPT ); Sun, 12 May 2019 06:10:46 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=nxp.com; s=selector2; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=6wuIo6HOAurjSt+aDMfDV8FbKRa8xOivaU3FlKtLty0=; b=FL9g5cIPwiDXOLYzjDG8z2/hqmC2+iRy8DrgL+3QCLWP0aZ+ACQ8/n6ASo2SdcjQHPHH9BIbrcdyqSaDalpynRwYbSfkfjj+9u0mlJ4M5VG9IvwEclHFAbJix2kiZlmYQpTNsxDYwcH8SzavRmnfAV6RZnVx2uUtnFruy49VQCI= Received: from DB3PR0402MB3916.eurprd04.prod.outlook.com (52.134.72.18) by DB3PR0402MB3913.eurprd04.prod.outlook.com (52.134.65.143) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.1878.21; Sun, 12 May 2019 10:10:41 +0000 Received: from DB3PR0402MB3916.eurprd04.prod.outlook.com ([fe80::d035:3bd0:a56a:189d]) by DB3PR0402MB3916.eurprd04.prod.outlook.com ([fe80::d035:3bd0:a56a:189d%2]) with mapi id 15.20.1878.022; Sun, 12 May 2019 10:10:41 +0000 From: Anson Huang To: "robh+dt@kernel.org" , "mark.rutland@arm.com" , "wim@linux-watchdog.org" , "linux@roeck-us.net" , "shawnguo@kernel.org" , "s.hauer@pengutronix.de" , "kernel@pengutronix.de" , "festevam@gmail.com" , Aisheng Dong , "ulf.hansson@linaro.org" , Daniel Baluta , Peng Fan , "devicetree@vger.kernel.org" , "linux-kernel@vger.kernel.org" , "linux-watchdog@vger.kernel.org" , "linux-arm-kernel@lists.infradead.org" CC: dl-linux-imx Subject: [PATCH RESEND V4 3/3] watchdog: imx_sc: Add pretimeout support Thread-Topic: [PATCH RESEND V4 3/3] watchdog: imx_sc: Add pretimeout support Thread-Index: AQHVCKr01hwB7BwH3ke9VyqgyH1V+A== Date: Sun, 12 May 2019 10:10:41 +0000 Message-ID: <1557655528-12816-3-git-send-email-Anson.Huang@nxp.com> References: <1557655528-12816-1-git-send-email-Anson.Huang@nxp.com> In-Reply-To: <1557655528-12816-1-git-send-email-Anson.Huang@nxp.com> Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-mailer: git-send-email 2.7.4 x-clientproxiedby: HK0P153CA0036.APCP153.PROD.OUTLOOK.COM (2603:1096:203:17::24) To DB3PR0402MB3916.eurprd04.prod.outlook.com (2603:10a6:8:10::18) authentication-results: spf=none (sender IP is ) smtp.mailfrom=anson.huang@nxp.com; x-ms-exchange-messagesentrepresentingtype: 1 x-originating-ip: [119.31.174.66] x-ms-publictraffictype: Email x-ms-office365-filtering-correlation-id: a3cd9123-28d2-46e5-675e-08d6d6c21666 x-ms-office365-filtering-ht: Tenant x-microsoft-antispam: BCL:0;PCL:0;RULEID:(2390118)(7020095)(4652040)(8989299)(4534185)(4627221)(201703031133081)(201702281549075)(8990200)(5600141)(711020)(4605104)(4618075)(2017052603328)(7193020);SRVR:DB3PR0402MB3913; x-ms-traffictypediagnostic: DB3PR0402MB3913: x-microsoft-antispam-prvs: x-ms-oob-tlc-oobclassifiers: OLM:2331; x-forefront-prvs: 0035B15214 x-forefront-antispam-report: SFV:NSPM;SFS:(10009020)(136003)(39860400002)(396003)(366004)(346002)(376002)(189003)(199004)(66556008)(11346002)(66066001)(73956011)(256004)(6512007)(2616005)(66446008)(64756008)(476003)(3846002)(66476007)(14444005)(66946007)(14454004)(6506007)(2201001)(386003)(6116002)(2501003)(102836004)(86362001)(6436002)(478600001)(53936002)(6486002)(71190400001)(26005)(71200400001)(186003)(8676002)(76176011)(4326008)(99286004)(25786009)(8936002)(81156014)(36756003)(446003)(50226002)(81166006)(52116002)(316002)(68736007)(5660300002)(110136005)(7416002)(2906002)(486006)(7736002)(305945005)(921003)(1121003);DIR:OUT;SFP:1101;SCL:1;SRVR:DB3PR0402MB3913;H:DB3PR0402MB3916.eurprd04.prod.outlook.com;FPR:;SPF:None;LANG:en;PTR:InfoNoRecords;MX:1;A:1; received-spf: None (protection.outlook.com: nxp.com does not designate permitted sender hosts) x-ms-exchange-senderadcheck: 1 x-microsoft-antispam-message-info: 2qoZas5B0XJPHTQHkTzEOKBQy31xUXfgd1LgvMlaFM8TQO6Bh8Bj/fNpJjHz8kJTTTTSbo0SQpqgqA018YWeHsWua6Xh5rxyun9+4u3dKKo55HIl214ycIaaragiFmLIDiR0hJj7kHoV6edIaPbQm3F2RwAJxXzTFklVmk5UBSAjK7VJ1bsy7+pTq6dx4E5Skj7oHeHlhsszCaHmsc6L2JdwQyWkHf+RcgFuYc7bwP3B93n4qXWHo3dwtocfNKPySkqXokxttqbcXHIPryq92DDhO4oYxxHZHknl2TesIdsQTukoo8gbRQ1phCVBxN2DkACRMLui0tXXfg0gUuwImupMEaDJOiHuD3DWW/Xg7uAioQqQTAYtsUulI4K2eJvsc4YpXO2sNL+AZaJ/NDYKu6xkiN2XdMwdzg2zOaVo+9Q= Content-ID: <1FC568C52C47F54C88ABBA9ECC17E04C@eurprd04.prod.outlook.com> MIME-Version: 1.0 X-OriginatorOrg: nxp.com X-MS-Exchange-CrossTenant-Network-Message-Id: a3cd9123-28d2-46e5-675e-08d6d6c21666 X-MS-Exchange-CrossTenant-originalarrivaltime: 12 May 2019 10:10:41.2066 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: 686ea1d3-bc2b-4c6f-a92c-d99c5c301635 X-MS-Exchange-CrossTenant-mailboxtype: HOSTED X-MS-Exchange-Transport-CrossTenantHeadersStamped: DB3PR0402MB3913 Sender: linux-watchdog-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-watchdog@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP i.MX system controller watchdog can support pretimeout IRQ via general SCU MU IRQ, it depends on IMX_SCU and driver MUST be probed after SCU IPC ready, then enable corresponding SCU IRQ group and register SCU IRQ notifier, when watchdog pretimeout IRQ fires, SCU MU IRQ will be handled and watchdog pretimeout notifier will be called to handle the event. Signed-off-by: Anson Huang --- No change, just resend patch with correct encoding. --- drivers/watchdog/Kconfig | 1 + drivers/watchdog/imx_sc_wdt.c | 116 +++++++++++++++++++++++++++++++++++------- 2 files changed, 98 insertions(+), 19 deletions(-) diff --git a/drivers/watchdog/Kconfig b/drivers/watchdog/Kconfig index 7ea6037..e08238c 100644 --- a/drivers/watchdog/Kconfig +++ b/drivers/watchdog/Kconfig @@ -716,6 +716,7 @@ config IMX2_WDT config IMX_SC_WDT tristate "IMX SC Watchdog" depends on HAVE_ARM_SMCCC + depends on IMX_SCU select WATCHDOG_CORE help This is the driver for the system controller watchdog diff --git a/drivers/watchdog/imx_sc_wdt.c b/drivers/watchdog/imx_sc_wdt.c index 49848b6..6ecc03f 100644 --- a/drivers/watchdog/imx_sc_wdt.c +++ b/drivers/watchdog/imx_sc_wdt.c @@ -4,6 +4,7 @@ */ #include +#include #include #include #include @@ -33,11 +34,19 @@ #define SC_TIMER_WDOG_ACTION_PARTITION 0 +#define SC_IRQ_WDOG 1 +#define SC_IRQ_GROUP_WDOG 1 + static bool nowayout = WATCHDOG_NOWAYOUT; module_param(nowayout, bool, 0000); MODULE_PARM_DESC(nowayout, "Watchdog cannot be stopped once started (default=" __MODULE_STRING(WATCHDOG_NOWAYOUT) ")"); +struct imx_sc_wdt_device { + struct watchdog_device wdd; + struct notifier_block wdt_notifier; +}; + static int imx_sc_wdt_ping(struct watchdog_device *wdog) { struct arm_smccc_res res; @@ -85,24 +94,66 @@ static int imx_sc_wdt_set_timeout(struct watchdog_device *wdog, return res.a0 ? -EACCES : 0; } +static int imx_sc_wdt_set_pretimeout(struct watchdog_device *wdog, + unsigned int pretimeout) +{ + struct arm_smccc_res res; + + arm_smccc_smc(IMX_SIP_TIMER, IMX_SIP_TIMER_SET_PRETIME_WDOG, + pretimeout * 1000, 0, 0, 0, 0, 0, &res); + if (res.a0) + return -EACCES; + + wdog->pretimeout = pretimeout; + + return 0; +} + +static int imx_sc_wdt_notify(struct notifier_block *nb, + unsigned long event, void *group) +{ + struct imx_sc_wdt_device *imx_sc_wdd = + container_of(nb, + struct imx_sc_wdt_device, + wdt_notifier); + + if (event & SC_IRQ_WDOG && + *(u8 *)group == SC_IRQ_GROUP_WDOG) + watchdog_notify_pretimeout(&imx_sc_wdd->wdd); + + return 0; +} + +static void imx_sc_wdt_action(void *data) +{ + struct notifier_block *wdt_notifier = data; + + imx_scu_irq_unregister_notifier(wdt_notifier); + imx_scu_irq_group_enable(SC_IRQ_GROUP_WDOG, + SC_IRQ_WDOG, + false); +} + static const struct watchdog_ops imx_sc_wdt_ops = { .owner = THIS_MODULE, .start = imx_sc_wdt_start, .stop = imx_sc_wdt_stop, .ping = imx_sc_wdt_ping, .set_timeout = imx_sc_wdt_set_timeout, + .set_pretimeout = imx_sc_wdt_set_pretimeout, }; -static const struct watchdog_info imx_sc_wdt_info = { +static struct watchdog_info imx_sc_wdt_info = { .identity = "i.MX SC watchdog timer", .options = WDIOF_SETTIMEOUT | WDIOF_KEEPALIVEPING | - WDIOF_MAGICCLOSE | WDIOF_PRETIMEOUT, + WDIOF_MAGICCLOSE, }; static int imx_sc_wdt_probe(struct platform_device *pdev) { + struct imx_sc_wdt_device *imx_sc_wdd; + struct watchdog_device *wdog; struct device *dev = &pdev->dev; - struct watchdog_device *imx_sc_wdd; int ret; imx_sc_wdd = devm_kzalloc(dev, sizeof(*imx_sc_wdd), GFP_KERNEL); @@ -111,42 +162,69 @@ static int imx_sc_wdt_probe(struct platform_device *pdev) platform_set_drvdata(pdev, imx_sc_wdd); - imx_sc_wdd->info = &imx_sc_wdt_info; - imx_sc_wdd->ops = &imx_sc_wdt_ops; - imx_sc_wdd->min_timeout = 1; - imx_sc_wdd->max_timeout = MAX_TIMEOUT; - imx_sc_wdd->parent = dev; - imx_sc_wdd->timeout = DEFAULT_TIMEOUT; + wdog = &imx_sc_wdd->wdd; + wdog->info = &imx_sc_wdt_info; + wdog->ops = &imx_sc_wdt_ops; + wdog->min_timeout = 1; + wdog->max_timeout = MAX_TIMEOUT; + wdog->parent = dev; + wdog->timeout = DEFAULT_TIMEOUT; - watchdog_init_timeout(imx_sc_wdd, 0, dev); - watchdog_stop_on_reboot(imx_sc_wdd); - watchdog_stop_on_unregister(imx_sc_wdd); + watchdog_init_timeout(wdog, 0, dev); + watchdog_stop_on_reboot(wdog); + watchdog_stop_on_unregister(wdog); - ret = devm_watchdog_register_device(dev, imx_sc_wdd); + ret = devm_watchdog_register_device(dev, wdog); if (ret) { dev_err(dev, "Failed to register watchdog device\n"); return ret; } + ret = imx_scu_irq_group_enable(SC_IRQ_GROUP_WDOG, + SC_IRQ_WDOG, + true); + if (ret) { + dev_warn(dev, "Enable irq failed, pretimeout NOT supported\n"); + return 0; + } + + imx_sc_wdd->wdt_notifier.notifier_call = imx_sc_wdt_notify; + ret = imx_scu_irq_register_notifier(&imx_sc_wdd->wdt_notifier); + if (ret) { + imx_scu_irq_group_enable(SC_IRQ_GROUP_WDOG, + SC_IRQ_WDOG, + false); + dev_warn(dev, + "Register irq notifier failed, pretimeout NOT supported\n"); + return 0; + } + + ret = devm_add_action_or_reset(dev, imx_sc_wdt_action, + &imx_sc_wdd->wdt_notifier); + if (!ret) + imx_sc_wdt_info.options |= WDIOF_PRETIMEOUT; + else + dev_warn(dev, "Add action failed, pretimeout NOT supported\n"); + return 0; } static int __maybe_unused imx_sc_wdt_suspend(struct device *dev) { - struct watchdog_device *imx_sc_wdd = dev_get_drvdata(dev); + struct imx_sc_wdt_device *imx_sc_wdd = dev_get_drvdata(dev); - if (watchdog_active(imx_sc_wdd)) - imx_sc_wdt_stop(imx_sc_wdd); + if (watchdog_active(&imx_sc_wdd->wdd)) + imx_sc_wdt_stop(&imx_sc_wdd->wdd); return 0; } static int __maybe_unused imx_sc_wdt_resume(struct device *dev) { - struct watchdog_device *imx_sc_wdd = dev_get_drvdata(dev); + struct imx_sc_wdt_device *imx_sc_wdd = dev_get_drvdata(dev); - if (watchdog_active(imx_sc_wdd)) - imx_sc_wdt_start(imx_sc_wdd); + if (watchdog_active(&imx_sc_wdd->wdd)) + imx_sc_wdt_start(&imx_sc_wdd->wdd); return 0; }