From patchwork Thu Nov 29 02:37:24 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Anson Huang X-Patchwork-Id: 10703835 X-Patchwork-Delegate: eduardo.valentin@ti.com 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 4D20714D6 for ; Thu, 29 Nov 2018 02:37:35 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 413A52DB93 for ; Thu, 29 Nov 2018 02:37:35 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 34B0C2E6E8; Thu, 29 Nov 2018 02:37:35 +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 BB4ED2DB93 for ; Thu, 29 Nov 2018 02:37:34 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727406AbeK2NlT (ORCPT ); Thu, 29 Nov 2018 08:41:19 -0500 Received: from mail-eopbgr20058.outbound.protection.outlook.com ([40.107.2.58]:53984 "EHLO EUR02-VE1-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1727026AbeK2NlT (ORCPT ); Thu, 29 Nov 2018 08:41:19 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=nxp.com; s=selector1; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=yTOUvexBgW2lFICcLtAz9oEpbcaBMQvYkUuYUkP/EhI=; b=nIRdG+73px9skwJgqDqHv0FTN21sYYFhYOwFgIZlIgyGoVT3h525Rb5uVUkwV9dGoV7wnSSyO8nRZw+pC8+BzvFU8uZrUjNqeJ5hZvowfWTci4MINkUyNOtIJxLDxDiUGOVaMTEzt4BS9jbJQ0zwnefBqKWvPXtinRE1qkGkTVc= Received: from DB3PR0402MB3916.eurprd04.prod.outlook.com (52.134.72.18) by DB3PR0402MB3946.eurprd04.prod.outlook.com (52.134.72.13) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.1361.19; Thu, 29 Nov 2018 02:37:24 +0000 Received: from DB3PR0402MB3916.eurprd04.prod.outlook.com ([fe80::adf8:f49d:deb4:58fd]) by DB3PR0402MB3916.eurprd04.prod.outlook.com ([fe80::adf8:f49d:deb4:58fd%2]) with mapi id 15.20.1361.019; Thu, 29 Nov 2018 02:37:24 +0000 From: Anson Huang To: "rui.zhang@intel.com" , "edubezval@gmail.com" , "daniel.lezcano@linaro.org" , "robh+dt@kernel.org" , "mark.rutland@arm.com" , "catalin.marinas@arm.com" , "will.deacon@arm.com" , Aisheng DONG , Andy Gross , "heiko@sntech.de" , "horms+renesas@verge.net.au" , "arnd@arndb.de" , "amit.kucheria@linaro.org" , "enric.balletbo@collabora.com" , "ezequiel@collabora.com" , "olof@lixom.net" , "bjorn.andersson@linaro.org" , "shawnguo@kernel.org" , "LW@KARO-electronics.de" , "linux-pm@vger.kernel.org" , "devicetree@vger.kernel.org" , "linux-kernel@vger.kernel.org" , "linux-arm-kernel@lists.infradead.org" CC: dl-linux-imx Subject: [PATCH V4 1/4] dt-bindings: fsl: scu: add thermal binding Thread-Topic: [PATCH V4 1/4] dt-bindings: fsl: scu: add thermal binding Thread-Index: AQHUh4x1H6AtxquUkUqUAgXdysttag== Date: Thu, 29 Nov 2018 02:37:24 +0000 Message-ID: <1543458696-4741-2-git-send-email-Anson.Huang@nxp.com> References: <1543458696-4741-1-git-send-email-Anson.Huang@nxp.com> In-Reply-To: <1543458696-4741-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: HK0PR04CA0011.apcprd04.prod.outlook.com (2603:1096:203:36::23) 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-microsoft-exchange-diagnostics: 1;DB3PR0402MB3946;6:3m54F/OapJi8Nxuv1mfD6iiKWtjtuFCAwFSyJQkQOAPMfJUJDnLOWsgfoKhusKrInVGaz3x9K+soMerbY0+1jTkTDrauypnir62Up3RFkikWkVsix7Za3+zy3Qk7aAvUi2lyb5RDHwr3kljmf0+SfTNjhfQ3KNVuzS98xSZoLCOJAvVVsHOvpxXza28t9bm1Chp+N1tVWm33nGNBBV5NPw/oJhHBdCrCJW5gSe9tg5ARbgJQzzgY5IVQONROYP/MXvQbKzCC9xMeScEr2DgCz4prp60y2engWycd6Dom574X5Lna+25I0DsSzFDjydEtV5azqLBDqPzNPMS/vy0Iaz3CcQc06If51YCdSHcU1rxbwnWu69HnfvnpZl4EFYD3Yim5LxH2a1fJzeMpWa69NZPdQ89qe68FVAXU5+eQKpR8cfkMNh7mbU1hXzPaIydgMHbcgWvkahqdOaDxk216xA==;5:02UTLuuTSgyWIjhbxxYMrF5k3ESuLQ5/ZRXVEQj9v7MMcyhUDY5kcPzkSHb9iJFbOZTcz5hBBJGVGfpL40xeqDr1Dy3D4sv03LWJ9oyOU+mdsAmCFEvbKpALEFcd86EZa3MuVX2As08gflHzW47qjQxhn9Zr8zCkaFDd90ctiHo=;7:y9FWlFacJEOXcb9SfNe6QfKB8Yr4HTkDndbtkeuLPAfPdNAvaJxjA3VxQLOSQkL32PHgk913oyEgok3zLgBbhxbRrn4t+iOeUpxmIhnIjvHp2z2D5yCd2sBrgm9iry/dS6T3BUI/04QHNXZiPnYy3Q== x-ms-office365-filtering-correlation-id: 13fdb96e-076f-4ccb-91bb-08d655a39847 x-ms-office365-filtering-ht: Tenant x-microsoft-antispam: BCL:0;PCL:0;RULEID:(2390098)(7020095)(4652040)(8989299)(5600074)(711020)(4618075)(4534185)(4627221)(201703031133081)(201702281549075)(8990200)(2017052603328)(7153060)(7193020);SRVR:DB3PR0402MB3946; x-ms-traffictypediagnostic: DB3PR0402MB3946: x-ld-processed: 686ea1d3-bc2b-4c6f-a92c-d99c5c301635,ExtAddr x-microsoft-antispam-prvs: x-ms-exchange-senderadcheck: 1 x-exchange-antispam-report-cfa-test: BCL:0;PCL:0;RULEID:(8211001083)(6040522)(2401047)(5005006)(8121501046)(3231453)(999002)(944501410)(52105112)(93006095)(93001095)(3002001)(10201501046)(6055026)(148016)(149066)(150057)(6041310)(20161123560045)(20161123562045)(20161123558120)(20161123564045)(201703131423095)(201702281528075)(20161123555045)(201703061421075)(201703061406153)(201708071742011)(7699051)(76991095);SRVR:DB3PR0402MB3946;BCL:0;PCL:0;RULEID:;SRVR:DB3PR0402MB3946; x-forefront-prvs: 0871917CDA x-forefront-antispam-report: SFV:NSPM;SFS:(10009020)(346002)(39860400002)(376002)(396003)(136003)(366004)(54534003)(199004)(189003)(25786009)(50226002)(99286004)(3846002)(6116002)(478600001)(8936002)(76176011)(14454004)(2201001)(52116002)(316002)(102836004)(106356001)(86362001)(110136005)(186003)(2906002)(26005)(81166006)(81156014)(8676002)(386003)(6506007)(68736007)(6512007)(7736002)(6486002)(6436002)(4326008)(66066001)(71190400001)(53936002)(39060400002)(36756003)(2501003)(71200400001)(305945005)(256004)(97736004)(105586002)(486006)(11346002)(446003)(2616005)(476003)(7416002)(5660300001)(921003)(1121003);DIR:OUT;SFP:1101;SCL:1;SRVR:DB3PR0402MB3946;H:DB3PR0402MB3916.eurprd04.prod.outlook.com;FPR:;SPF:None;LANG:en;PTR:InfoNoRecords;A:1;MX:1; received-spf: None (protection.outlook.com: nxp.com does not designate permitted sender hosts) x-microsoft-antispam-message-info: 1TO6HWpsb9qE7qUbWasNnrCLw4kKrd6wTqYcmM19JIV0l9B8wsqgXn1ahaqP7cZr5qr1FIc+h3svU7QzHIm71XCyfkJt+TgYvAOZrB2/Lo0Ufp7OiSEjGpmp1ZF492nV3ZaNoPKUYKEWz/PLMtodzH7DTkOa9UfGzAgcZo3xT89UAKsuwEtR/RlNPB8qmQ7dI5p6g41GyYGkDfYjJcieuHzdm3qQJlaUW2yGfy873FakEVm9PGsCFxW8SSBWcizMo0UMnU+6lDSdTR6ib0Mi8p5n7IKpJCXU0JFMn+hj1W6LcU60qysFB/dBd1DSK950fFtfgDdUGGVt18CStXRnLWL40m399ghEeWgvibuhNg0= spamdiagnosticoutput: 1:99 spamdiagnosticmetadata: NSPM MIME-Version: 1.0 X-OriginatorOrg: nxp.com X-MS-Exchange-CrossTenant-Network-Message-Id: 13fdb96e-076f-4ccb-91bb-08d655a39847 X-MS-Exchange-CrossTenant-originalarrivaltime: 29 Nov 2018 02:37:24.5017 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: 686ea1d3-bc2b-4c6f-a92c-d99c5c301635 X-MS-Exchange-Transport-CrossTenantHeadersStamped: DB3PR0402MB3946 Sender: linux-pm-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-pm@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP NXP i.MX8QXP is an ARMv8 SoC with a Cortex-M4 core inside as system controller, the system controller is in charge of system power, clock and thermal sensors etc. management, Linux kernel has to communicate with system controller via MU (message unit) IPC to get temperature from thermal sensors, this patch adds binding doc for i.MX system controller thermal driver. Signed-off-by: Anson Huang Reviewed-by: Rob Herring --- ChangeLog: V3->V4: *move binding doc to SCU since it is belonging to SCU; *change compatile string to start with "fsl" instead of "nxp" to align with other nodes in dtb. --- .../devicetree/bindings/arm/freescale/fsl,scu.txt | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/Documentation/devicetree/bindings/arm/freescale/fsl,scu.txt b/Documentation/devicetree/bindings/arm/freescale/fsl,scu.txt index 3f3d697..b77ec29 100644 --- a/Documentation/devicetree/bindings/arm/freescale/fsl,scu.txt +++ b/Documentation/devicetree/bindings/arm/freescale/fsl,scu.txt @@ -112,6 +112,16 @@ RTC bindings based on SCU Message Protocol Required properties: - compatible: should be "fsl,imx8qxp-sc-rtc"; +Thermal bindings based on SCU Message Protocol +------------------------------------------------------------ + +Required properties: +- compatible : Must be "fsl,imx8qxp-sc-thermal"; +- tsens-num : Total number of thermal sensors supported; +- #thermal-sensor-cells : Should be 1. See + Documentation/devicetree/bindings/thermal/thermal.txt + for a description. + Example (imx8qxp): ------------- lsio_mu1: mailbox@5d1c0000 { @@ -158,6 +168,12 @@ firmware { rtc: rtc { compatible = "fsl,imx8qxp-sc-rtc"; }; + + tsens: thermal-sensor { + compatible = "fsl,imx8qxp-sc-thermal"; + tsens-num = <1>; + #thermal-sensor-cells = <1>; + }; }; }; From patchwork Thu Nov 29 02:37:32 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Anson Huang X-Patchwork-Id: 10703839 X-Patchwork-Delegate: eduardo.valentin@ti.com 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 7FB5A13AD for ; Thu, 29 Nov 2018 02:37:39 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 760522DB93 for ; Thu, 29 Nov 2018 02:37:39 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 6A08C2E6EC; Thu, 29 Nov 2018 02:37:39 +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 A1E0B2DB93 for ; Thu, 29 Nov 2018 02:37:38 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727747AbeK2NlX (ORCPT ); Thu, 29 Nov 2018 08:41:23 -0500 Received: from mail-eopbgr40064.outbound.protection.outlook.com ([40.107.4.64]:60817 "EHLO EUR03-DB5-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1727026AbeK2NlW (ORCPT ); Thu, 29 Nov 2018 08:41:22 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=nxp.com; s=selector1; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=3Xq28o9USIrqfOVSXbIPBcnSA0mFm+2ZGie5S3Xw2jc=; b=IbmuXktaXAYD9AImym4YySgPBLt0W824a/sFkFRnPzJ4zzfQkmLzenp2bzWf+pHcAOSa3ezf1BRbJtIvl9eRuzG9y/N6ngbDoZBYkXYxi8s/yIzFc1jfUvDQ49IvVYYOJ6OJjcNFxemWpPsJVncfd7fS+jFYl1k6uEue/8MrOkY= Received: from DB3PR0402MB3916.eurprd04.prod.outlook.com (52.134.72.18) by DB3PR0402MB3946.eurprd04.prod.outlook.com (52.134.72.13) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.1361.19; Thu, 29 Nov 2018 02:37:32 +0000 Received: from DB3PR0402MB3916.eurprd04.prod.outlook.com ([fe80::adf8:f49d:deb4:58fd]) by DB3PR0402MB3916.eurprd04.prod.outlook.com ([fe80::adf8:f49d:deb4:58fd%2]) with mapi id 15.20.1361.019; Thu, 29 Nov 2018 02:37:32 +0000 From: Anson Huang To: "rui.zhang@intel.com" , "edubezval@gmail.com" , "daniel.lezcano@linaro.org" , "robh+dt@kernel.org" , "mark.rutland@arm.com" , "catalin.marinas@arm.com" , "will.deacon@arm.com" , Aisheng DONG , Andy Gross , "heiko@sntech.de" , "horms+renesas@verge.net.au" , "arnd@arndb.de" , "amit.kucheria@linaro.org" , "enric.balletbo@collabora.com" , "ezequiel@collabora.com" , "olof@lixom.net" , "bjorn.andersson@linaro.org" , "shawnguo@kernel.org" , "LW@KARO-electronics.de" , "linux-pm@vger.kernel.org" , "devicetree@vger.kernel.org" , "linux-kernel@vger.kernel.org" , "linux-arm-kernel@lists.infradead.org" CC: dl-linux-imx Subject: [PATCH V4 2/4] thermal: imx_sc: add i.MX system controller thermal support Thread-Topic: [PATCH V4 2/4] thermal: imx_sc: add i.MX system controller thermal support Thread-Index: AQHUh4x6dY7vZjVYpE+4w9SclFRzpA== Date: Thu, 29 Nov 2018 02:37:32 +0000 Message-ID: <1543458696-4741-3-git-send-email-Anson.Huang@nxp.com> References: <1543458696-4741-1-git-send-email-Anson.Huang@nxp.com> In-Reply-To: <1543458696-4741-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: HK0PR04CA0011.apcprd04.prod.outlook.com (2603:1096:203:36::23) 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-microsoft-exchange-diagnostics: 1;DB3PR0402MB3946;6:XKJxq8cG8v+lMttG/t77ZzobmQtW8aVqeVnrpzv3NTeeoSYfoPUQORoSLEH75fMwA0ZWpS17vt2B1n26DMAnyQ+PIHVFuCjib7PzI3I4MZKs4IzcJ0di9Nrev/21C1xLm/b8otKPvCXwYR6IKAy2Sgbuufbw4+QMXvb+QSgcb8QxSdbbbg5aaEZCrRmvt50ILA8VPlmokRlUhVml2mwNTWZRxtFsbdK+OYr9dxU72+fQDhtuChMOqzAYDKRZk/MiaSgoPmxHkVhg+PquJhFVOUWbFpPMopjsdkW3ztyRHysmRGbKCyXUJHR0gx+owQYty0BYysclEjxEMwibt2gceOddphPaR+Z2RChmvmgg6TvM65ZSPr35unR7BI2wQ3Vh/smODDrEMDmLthuJdRZolktykljTtaLQZ+t/6SAiLp3g39qFbcUr/HKOU4D6rOK1JrAE8eIC6m048oddo33ilQ==;5:bE31FLh5oYDV9QqUejO17wh9yEdtKt4cmk0B2gykljiHr9RprWnSqpnlk5e6Z/VhyUslA4QOF/Pvk23tSk4WJL3Ctuk7x2HHT2x4fCb/ae+9u2pPGns98+mgCWK6oCaj+kmLsIpAnlRx7eGuyS5RrGN9j+mhBLXdYIK7jSxhTpg=;7:eLVk76SmtW7GPT0FcthsQbyxAtHO7op9mdS/yIEoBsagiF2x9mpzO9YaeSF+42e4vy6IfO8brxK44ZCsjzU+YS9ASJybTMQnrTiEr1Drr2S4VQjcIEpFk8zuArO6ed3OEAHmFJuMfSQQccq6zXm95w== x-ms-office365-filtering-correlation-id: 8a5f7f8e-059a-411c-5c33-08d655a39ce1 x-ms-office365-filtering-ht: Tenant x-microsoft-antispam: BCL:0;PCL:0;RULEID:(2390098)(7020095)(4652040)(8989299)(5600074)(711020)(4618075)(4534185)(4627221)(201703031133081)(201702281549075)(8990200)(2017052603328)(7153060)(7193020);SRVR:DB3PR0402MB3946; x-ms-traffictypediagnostic: DB3PR0402MB3946: x-ld-processed: 686ea1d3-bc2b-4c6f-a92c-d99c5c301635,ExtAddr x-microsoft-antispam-prvs: x-ms-exchange-senderadcheck: 1 x-exchange-antispam-report-cfa-test: BCL:0;PCL:0;RULEID:(8211001083)(6040522)(2401047)(5005006)(8121501046)(3231453)(999002)(944501410)(52105112)(93006095)(93001095)(3002001)(10201501046)(6055026)(148016)(149066)(150057)(6041310)(20161123560045)(20161123562045)(20161123558120)(20161123564045)(201703131423095)(201702281528075)(20161123555045)(201703061421075)(201703061406153)(201708071742011)(7699051)(76991095);SRVR:DB3PR0402MB3946;BCL:0;PCL:0;RULEID:;SRVR:DB3PR0402MB3946; x-forefront-prvs: 0871917CDA x-forefront-antispam-report: SFV:NSPM;SFS:(10009020)(346002)(39860400002)(376002)(396003)(136003)(366004)(54534003)(199004)(189003)(25786009)(50226002)(99286004)(3846002)(6116002)(478600001)(8936002)(76176011)(14454004)(2201001)(52116002)(316002)(102836004)(106356001)(86362001)(110136005)(186003)(2906002)(26005)(81166006)(81156014)(8676002)(386003)(6506007)(68736007)(6512007)(7736002)(6486002)(6436002)(4326008)(66066001)(71190400001)(53936002)(39060400002)(36756003)(2501003)(71200400001)(305945005)(256004)(14444005)(97736004)(105586002)(486006)(11346002)(446003)(2616005)(476003)(7416002)(5660300001)(921003)(1121003);DIR:OUT;SFP:1101;SCL:1;SRVR:DB3PR0402MB3946;H:DB3PR0402MB3916.eurprd04.prod.outlook.com;FPR:;SPF:None;LANG:en;PTR:InfoNoRecords;A:1;MX:1; received-spf: None (protection.outlook.com: nxp.com does not designate permitted sender hosts) x-microsoft-antispam-message-info: BfIi0g28iIOf+wYmsNbBacqzG60ipbSgmb7qQWXWP2HKjnMSVWHDcygrK7soDlOyYV3qe1gFu4QAyGhWqTRvnLql182ltZHo+LQxp9vRQyCPFi9gGFETTEj9ASptKeN27HzGpzU/H/5C+lnBeCAM+9OUnrhGU3Vkek+Uny10Ul3XFKf/yHmfQ/7OQYCPK6zo6uk/uJ5QfgMxoKogMqduc643QfaAlaciVDN86o4/h11ewugucsykyipkhIk6qfrDEVPWpwAfg4fOv9Cn3zN7V+J0t1VkRqiU6iOXXZJVVvR8GFDFS1FizA8Hd/Zy8SpP6JxxKHoLwFE8KX+ZqJQ5cn6A/bX0WAMqqCTM2n25XzQ= spamdiagnosticoutput: 1:99 spamdiagnosticmetadata: NSPM MIME-Version: 1.0 X-OriginatorOrg: nxp.com X-MS-Exchange-CrossTenant-Network-Message-Id: 8a5f7f8e-059a-411c-5c33-08d655a39ce1 X-MS-Exchange-CrossTenant-originalarrivaltime: 29 Nov 2018 02:37:32.2830 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: 686ea1d3-bc2b-4c6f-a92c-d99c5c301635 X-MS-Exchange-Transport-CrossTenantHeadersStamped: DB3PR0402MB3946 Sender: linux-pm-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-pm@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP i.MX8QXP is an ARMv8 SoC which has a Cortex-M4 system controller inside, the system controller is in charge of controlling power, clock and thermal sensors etc.. This patch adds i.MX system controller thermal driver support, Linux kernel has to communicate with system controller via MU (message unit) IPC to get each thermal sensor's temperature, it supports multiple sensors which are passed from device tree, please see the binding doc for details. Signed-off-by: Anson Huang --- ChangeLog: V3->V4: *merge request/response message structure into one struction; *change the compatible string to start with "fsl" instead of "nxp" to align with other nodes in dtb. --- drivers/thermal/Kconfig | 11 +++ drivers/thermal/Makefile | 1 + drivers/thermal/imx_sc_thermal.c | 205 +++++++++++++++++++++++++++++++++++++++ 3 files changed, 217 insertions(+) create mode 100644 drivers/thermal/imx_sc_thermal.c diff --git a/drivers/thermal/Kconfig b/drivers/thermal/Kconfig index 0e69edc..84e850c 100644 --- a/drivers/thermal/Kconfig +++ b/drivers/thermal/Kconfig @@ -222,6 +222,17 @@ config IMX_THERMAL cpufreq is used as the cooling device to throttle CPUs when the passive trip is crossed. +config IMX_SC_THERMAL + tristate "Temperature sensor driver for NXP i.MX SoCs with System Controller" + depends on ARCH_MXC || COMPILE_TEST + depends on OF + help + Support for Temperature Monitor (TEMPMON) found on NXP i.MX SoCs with + system controller inside, Linux kernel has to communicate with system + controller via MU (message unit) IPC to get temperature from thermal + sensor. It supports one critical trip point and one + passive trip point for each thermal sensor. + config MAX77620_THERMAL tristate "Temperature sensor driver for Maxim MAX77620 PMIC" depends on MFD_MAX77620 diff --git a/drivers/thermal/Makefile b/drivers/thermal/Makefile index 610344e..1b13f6a 100644 --- a/drivers/thermal/Makefile +++ b/drivers/thermal/Makefile @@ -41,6 +41,7 @@ obj-$(CONFIG_DB8500_THERMAL) += db8500_thermal.o obj-$(CONFIG_ARMADA_THERMAL) += armada_thermal.o obj-$(CONFIG_TANGO_THERMAL) += tango_thermal.o obj-$(CONFIG_IMX_THERMAL) += imx_thermal.o +obj-$(CONFIG_IMX_SC_THERMAL) += imx_sc_thermal.o obj-$(CONFIG_MAX77620_THERMAL) += max77620_thermal.o obj-$(CONFIG_QORIQ_THERMAL) += qoriq_thermal.o obj-$(CONFIG_DA9062_THERMAL) += da9062-thermal.o diff --git a/drivers/thermal/imx_sc_thermal.c b/drivers/thermal/imx_sc_thermal.c new file mode 100644 index 0000000..ce8e2de --- /dev/null +++ b/drivers/thermal/imx_sc_thermal.c @@ -0,0 +1,205 @@ +// SPDX-License-Identifier: GPL-2.0+ +/* + * Copyright 2018 NXP. + */ + +#include +#include +#include +#include +#include +#include +#include +#include + +#include "thermal_core.h" + +#define IMX_SC_MISC_FUNC_GET_TEMP 13 +#define IMX_SC_C_TEMP 0 + +static struct imx_sc_ipc *thermal_ipc_handle; + +struct imx_sc_sensor { + struct thermal_zone_device *tzd; + u32 resource_id; +}; + +struct imx_sc_thermal_data { + struct imx_sc_sensor *sensor; +}; + +struct req_get_temp { + u16 resource_id; + u8 type; +} __packed; + +struct resp_get_temp { + u16 celsius; + u8 tenths; +} __packed; + +struct imx_sc_msg_misc_get_temp { + struct imx_sc_rpc_msg hdr; + union { + struct req_get_temp req; + struct resp_get_temp resp; + } data; +} __packed; + +static int imx_sc_thermal_get_temp(void *data, int *temp) +{ + struct imx_sc_msg_misc_get_temp msg; + struct imx_sc_rpc_msg *hdr = &msg.hdr; + struct imx_sc_sensor *sensor = data; + int ret; + + msg.data.req.resource_id = sensor->resource_id; + msg.data.req.type = IMX_SC_C_TEMP; + + hdr->ver = IMX_SC_RPC_VERSION; + hdr->svc = IMX_SC_RPC_SVC_MISC; + hdr->func = IMX_SC_MISC_FUNC_GET_TEMP; + hdr->size = 2; + + ret = imx_scu_call_rpc(thermal_ipc_handle, &msg, true); + if (ret) { + pr_err("read temp sensor %d failed, ret %d\n", + sensor->resource_id, ret); + return ret; + } + + *temp = msg.data.resp.celsius * 1000 + msg.data.resp.tenths * 100; + + return 0; +} + +static const struct thermal_zone_of_device_ops imx_sc_thermal_ops = { + .get_temp = imx_sc_thermal_get_temp, +}; + +static int imx_sc_thermal_register_sensor(struct platform_device *pdev, + struct imx_sc_sensor *sensor) +{ + struct thermal_zone_device *tzd; + + tzd = devm_thermal_zone_of_sensor_register(&pdev->dev, + sensor->resource_id, + sensor, + &imx_sc_thermal_ops); + if (IS_ERR(tzd)) { + dev_err(&pdev->dev, "failed to register sensor: %d\n", + sensor->resource_id); + return PTR_ERR(tzd); + } + + sensor->tzd = tzd; + + return 0; +} + +static int imx_sc_thermal_get_sensor_id(struct device_node *sensor_np, u32 *id) +{ + struct of_phandle_args sensor_specs; + int ret; + + ret = of_parse_phandle_with_args(sensor_np, "thermal-sensors", + "#thermal-sensor-cells", + 0, &sensor_specs); + if (ret) + return ret; + + if (sensor_specs.args_count >= 1) { + *id = sensor_specs.args[0]; + WARN(sensor_specs.args_count > 1, + "%pOFn: too many cells in sensor specifier %d\n", + sensor_specs.np, sensor_specs.args_count); + } else { + return -EINVAL; + } + + return 0; +} + +static int imx_sc_thermal_probe(struct platform_device *pdev) +{ + struct device_node *np = pdev->dev.of_node; + struct device_node *sensor_np = NULL; + struct imx_sc_thermal_data *data; + struct imx_sc_sensor *sensors; + u32 sensor_num; + int ret, i; + + ret = imx_scu_get_handle(&thermal_ipc_handle); + if (ret) { + if (ret == -EPROBE_DEFER) + return ret; + + dev_err(&pdev->dev, "failed to get ipc handle: %d!\n", ret); + return ret; + } + + data = devm_kzalloc(&pdev->dev, sizeof(*data), GFP_KERNEL); + if (!data) + return -ENOMEM; + + ret = of_property_read_u32(np, "tsens-num", &sensor_num); + if (ret || !sensor_num) { + dev_err(&pdev->dev, "failed to get valid temp sensor number!\n"); + return -EINVAL; + } + + sensors = devm_kzalloc(&pdev->dev, sizeof(*data->sensor) * sensor_num, + GFP_KERNEL); + if (!sensors) + return -ENOMEM; + + data->sensor = sensors; + + np = of_find_node_by_name(NULL, "thermal-zones"); + if (!np) + return -ENODEV; + + for (i = 0; i < sensor_num; i++) { + struct imx_sc_sensor *sensor = &data->sensor[i]; + + sensor_np = of_get_next_child(np, sensor_np); + ret = imx_sc_thermal_get_sensor_id(sensor_np, &sensor->resource_id); + if (ret < 0) { + dev_err(&pdev->dev, + "failed to get valid sensor resource id: %d\n", + ret); + break; + } + + ret = imx_sc_thermal_register_sensor(pdev, sensor); + if (ret) { + dev_err(&pdev->dev, "failed to register thermal sensor: %d\n", + ret); + break; + } + } + + of_node_put(np); + of_node_put(sensor_np); + + return ret; +} + +static const struct of_device_id imx_sc_thermal_table[] = { + { .compatible = "fsl,imx8qxp-sc-thermal", }, + {} +}; +MODULE_DEVICE_TABLE(of, imx_sc_thermal_table); + +static struct platform_driver imx_sc_thermal_driver = { + .probe = imx_sc_thermal_probe, + .driver = { + .name = "imx-sc-thermal", + .of_match_table = imx_sc_thermal_table, + }, +}; +module_platform_driver(imx_sc_thermal_driver); + +MODULE_AUTHOR("Anson Huang "); +MODULE_DESCRIPTION("Thermal driver for NXP i.MX SoCs with system controller"); +MODULE_LICENSE("GPL v2"); From patchwork Thu Nov 29 02:37:40 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Anson Huang X-Patchwork-Id: 10703843 X-Patchwork-Delegate: eduardo.valentin@ti.com 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 A914B14D6 for ; Thu, 29 Nov 2018 02:37:49 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 9EB062DB93 for ; Thu, 29 Nov 2018 02:37:49 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 921522E6E8; Thu, 29 Nov 2018 02:37:49 +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 2979B2DB93 for ; Thu, 29 Nov 2018 02:37:49 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727848AbeK2Nlb (ORCPT ); Thu, 29 Nov 2018 08:41:31 -0500 Received: from mail-eopbgr20062.outbound.protection.outlook.com ([40.107.2.62]:61360 "EHLO EUR02-VE1-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1727026AbeK2Nla (ORCPT ); Thu, 29 Nov 2018 08:41:30 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=nxp.com; s=selector1; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=sqkwAEgWvhvnxmFTFIVywPlME1oqixxzGKxhU1FSNas=; b=gCvimuX/T34kfc5SG/3cjbTRHg+ZDAyle1Gv4iQz3Qb6vAzwcGH6C4qg5+yhreudznywPrK9kLfYYZU/qU2P+wwi4KX+RJS1kHpUXyZe5Make2hKWUMP54XtaAQmUzhER37DdJB/lHgdvmykvbfyL30ATYmz93tcPNb0iDaSW2Y= Received: from DB3PR0402MB3916.eurprd04.prod.outlook.com (52.134.72.18) by DB3PR0402MB3946.eurprd04.prod.outlook.com (52.134.72.13) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.1361.19; Thu, 29 Nov 2018 02:37:40 +0000 Received: from DB3PR0402MB3916.eurprd04.prod.outlook.com ([fe80::adf8:f49d:deb4:58fd]) by DB3PR0402MB3916.eurprd04.prod.outlook.com ([fe80::adf8:f49d:deb4:58fd%2]) with mapi id 15.20.1361.019; Thu, 29 Nov 2018 02:37:40 +0000 From: Anson Huang To: "rui.zhang@intel.com" , "edubezval@gmail.com" , "daniel.lezcano@linaro.org" , "robh+dt@kernel.org" , "mark.rutland@arm.com" , "catalin.marinas@arm.com" , "will.deacon@arm.com" , Aisheng DONG , Andy Gross , "heiko@sntech.de" , "horms+renesas@verge.net.au" , "arnd@arndb.de" , "amit.kucheria@linaro.org" , "enric.balletbo@collabora.com" , "ezequiel@collabora.com" , "olof@lixom.net" , "bjorn.andersson@linaro.org" , "shawnguo@kernel.org" , "LW@KARO-electronics.de" , "linux-pm@vger.kernel.org" , "devicetree@vger.kernel.org" , "linux-kernel@vger.kernel.org" , "linux-arm-kernel@lists.infradead.org" CC: dl-linux-imx Subject: [PATCH V4 3/4] defconfig: arm64: add i.MX system controller thermal support Thread-Topic: [PATCH V4 3/4] defconfig: arm64: add i.MX system controller thermal support Thread-Index: AQHUh4x/dAiU5+dz1kW9lo5Be4HO6g== Date: Thu, 29 Nov 2018 02:37:40 +0000 Message-ID: <1543458696-4741-4-git-send-email-Anson.Huang@nxp.com> References: <1543458696-4741-1-git-send-email-Anson.Huang@nxp.com> In-Reply-To: <1543458696-4741-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: HK0PR04CA0011.apcprd04.prod.outlook.com (2603:1096:203:36::23) 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-microsoft-exchange-diagnostics: 1;DB3PR0402MB3946;6:YE21TuyFanNsCGrTiCvL23Hy7eLSBO2XphzkZtxNVeh70lGzMDlTQxXRhdTO0GRDNoUmYqbGyPf2QdWhByrbqmyb4RjGiXJV72Bz5FW79UlDin+lp6V7tW/iUAI+tETZOaSNcKPcBFTxNR0F0vfWtt2eUTXdOexcheQSfLM43+3NK4Ocq2TqLBp00jHTwa1L+ZPIoFy3WQUNzRtcEuPKBKz1eF6en9n+A+oWA4TyWXmXh/kQYZTyIDwM6Ggxm//7q7QKH1Yg25mtkCdmkIO/jLDOEoxOrOuBH76mAuiCzzv4pGBjiRXjRlcAaRwWDwW3rvbFMOFOwX0wduLgVwNKoCFI7AzLGChyjCdQOCWPun2MbpXBTCWiC2NnAa4WX2O5bpo5oe2a945L715lnyTEmbg6W8hk85OQJdvtZNpPharXxZdnUDGoeMGzf2z7uYPx9XGofaogPK2W3dB2cLMUzQ==;5:/M6xqa5j5J+yrRqH7Z/KygZQbh9P6RV8PN8gXus5oE9qcKQletz/CIV0jRK6eZ81FITIl5RBncdAQ46NXxpdUPPQC14QC8tAScAB8O3kMe8gfi6tPDqjxtigEXfRO3eoJS8ndcIXSuhQ5GMmUzF4bJGbiATAHx8ETONylDnELxY=;7:/e++WfeD4V4AtWlzGiommIs024vjZ7M0knnMwAJ5ILEcylUEjye4y2sqUNL3U4yI/m8UpqoMXW3bHkEO7XFQXUMWtfhHJL9pN6c56waqI72HYOxpKxlcwZP0UEm1gCMJ+tY9rJz6KDjpVmYkeoN0hQ== x-ms-office365-filtering-correlation-id: d09ed58f-620a-45b6-890b-08d655a3a17d x-ms-office365-filtering-ht: Tenant x-microsoft-antispam: BCL:0;PCL:0;RULEID:(2390098)(7020095)(4652040)(8989299)(5600074)(711020)(4618075)(4534185)(4627221)(201703031133081)(201702281549075)(8990200)(2017052603328)(7153060)(7193020);SRVR:DB3PR0402MB3946; x-ms-traffictypediagnostic: DB3PR0402MB3946: x-ld-processed: 686ea1d3-bc2b-4c6f-a92c-d99c5c301635,ExtAddr x-microsoft-antispam-prvs: x-ms-exchange-senderadcheck: 1 x-exchange-antispam-report-cfa-test: BCL:0;PCL:0;RULEID:(8211001083)(6040522)(2401047)(5005006)(8121501046)(3231453)(999002)(944501410)(52105112)(93006095)(93001095)(3002001)(10201501046)(6055026)(148016)(149066)(150057)(6041310)(20161123560045)(20161123562045)(20161123558120)(20161123564045)(201703131423095)(201702281528075)(20161123555045)(201703061421075)(201703061406153)(201708071742011)(7699051)(76991095);SRVR:DB3PR0402MB3946;BCL:0;PCL:0;RULEID:;SRVR:DB3PR0402MB3946; x-forefront-prvs: 0871917CDA x-forefront-antispam-report: SFV:NSPM;SFS:(10009020)(346002)(39860400002)(376002)(396003)(136003)(366004)(199004)(189003)(25786009)(50226002)(99286004)(3846002)(6116002)(478600001)(8936002)(76176011)(14454004)(2201001)(52116002)(316002)(102836004)(106356001)(86362001)(110136005)(186003)(2906002)(26005)(81166006)(81156014)(8676002)(386003)(6506007)(68736007)(6512007)(7736002)(6486002)(6436002)(4326008)(66066001)(71190400001)(53936002)(39060400002)(36756003)(2501003)(71200400001)(305945005)(256004)(97736004)(105586002)(486006)(11346002)(446003)(2616005)(476003)(7416002)(5660300001)(921003)(1121003);DIR:OUT;SFP:1101;SCL:1;SRVR:DB3PR0402MB3946;H:DB3PR0402MB3916.eurprd04.prod.outlook.com;FPR:;SPF:None;LANG:en;PTR:InfoNoRecords;A:1;MX:1; received-spf: None (protection.outlook.com: nxp.com does not designate permitted sender hosts) x-microsoft-antispam-message-info: jKwiCLVcY9a0eEZPabvUFT5kdfSnyyJc8cR1PQB9Zsi1b9DNtx00YtTeC3H61XFNvBEb6i4Csge+lKGUmFXjB8KODyWD7ZbNJeV/jCpeilVRrU4N1exltioVIpf3tjLJKc5VmfAlUwTdysjvabepUdATIqcNIJMINcVpnINBicifL1xFeCnAlLM8a7iLV8Lfo30KRpEOxKF6xluuqrDcgmM5uBCsYDBi6Aut4sYZ+6tYApwoXq27Zc/HJWBnz6Trv38xh/QsgfLQrNfesI0TqTTuAygB9mKedpqI9x6emxXC0bLUpdtLKavyBztaoN55ZsmsluakHDDAYU6UQ2ZpGaj9fNPdzah91a4XH0CfOEM= spamdiagnosticoutput: 1:99 spamdiagnosticmetadata: NSPM MIME-Version: 1.0 X-OriginatorOrg: nxp.com X-MS-Exchange-CrossTenant-Network-Message-Id: d09ed58f-620a-45b6-890b-08d655a3a17d X-MS-Exchange-CrossTenant-originalarrivaltime: 29 Nov 2018 02:37:40.1736 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: 686ea1d3-bc2b-4c6f-a92c-d99c5c301635 X-MS-Exchange-Transport-CrossTenantHeadersStamped: DB3PR0402MB3946 Sender: linux-pm-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-pm@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP This patch enables CONFIG_IMX_SC_THERMAL as module. Signed-off-by: Anson Huang --- arch/arm64/configs/defconfig | 1 + 1 file changed, 1 insertion(+) diff --git a/arch/arm64/configs/defconfig b/arch/arm64/configs/defconfig index abd80c5..9f12324 100644 --- a/arch/arm64/configs/defconfig +++ b/arch/arm64/configs/defconfig @@ -376,6 +376,7 @@ CONFIG_SENSORS_RASPBERRYPI_HWMON=m CONFIG_THERMAL_GOV_POWER_ALLOCATOR=y CONFIG_CPU_THERMAL=y CONFIG_THERMAL_EMULATION=y +CONFIG_IMX_SC_THERMAL=m CONFIG_ROCKCHIP_THERMAL=m CONFIG_RCAR_GEN3_THERMAL=y CONFIG_ARMADA_THERMAL=y From patchwork Thu Nov 29 02:37:47 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Anson Huang X-Patchwork-Id: 10703845 X-Patchwork-Delegate: eduardo.valentin@ti.com 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 C01C114D6 for ; Thu, 29 Nov 2018 02:37:54 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id B4BA02DB93 for ; Thu, 29 Nov 2018 02:37:54 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id A81EE2E6E8; Thu, 29 Nov 2018 02:37:54 +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 4141E2DB93 for ; Thu, 29 Nov 2018 02:37:54 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727570AbeK2Nlj (ORCPT ); Thu, 29 Nov 2018 08:41:39 -0500 Received: from mail-eopbgr20059.outbound.protection.outlook.com ([40.107.2.59]:62915 "EHLO EUR02-VE1-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1726954AbeK2Nli (ORCPT ); Thu, 29 Nov 2018 08:41:38 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=nxp.com; s=selector1; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=4V+NyPxjv59hXatRN9FiKRyEC1kB2CrzVSXmYVvAWbI=; b=Ats4BdQF6gZLXh7FIXSXHhZ5HzKO4reiAlbkBFypBcekxC9T2ldFK8QKneOdNgoh8p3ML6Hx/Kl3NdBSeb3boXYYMX/CpMNTHOuSvCqU5JZTbGIdV229qH+knIIfyt+8BJx/528tAgsW2icvw6ZwengJjA+TeX6IzM9K5StZW2E= Received: from DB3PR0402MB3916.eurprd04.prod.outlook.com (52.134.72.18) by DB3PR0402MB3946.eurprd04.prod.outlook.com (52.134.72.13) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.1361.19; Thu, 29 Nov 2018 02:37:48 +0000 Received: from DB3PR0402MB3916.eurprd04.prod.outlook.com ([fe80::adf8:f49d:deb4:58fd]) by DB3PR0402MB3916.eurprd04.prod.outlook.com ([fe80::adf8:f49d:deb4:58fd%2]) with mapi id 15.20.1361.019; Thu, 29 Nov 2018 02:37:48 +0000 From: Anson Huang To: "rui.zhang@intel.com" , "edubezval@gmail.com" , "daniel.lezcano@linaro.org" , "robh+dt@kernel.org" , "mark.rutland@arm.com" , "catalin.marinas@arm.com" , "will.deacon@arm.com" , Aisheng DONG , Andy Gross , "heiko@sntech.de" , "horms+renesas@verge.net.au" , "arnd@arndb.de" , "amit.kucheria@linaro.org" , "enric.balletbo@collabora.com" , "ezequiel@collabora.com" , "olof@lixom.net" , "bjorn.andersson@linaro.org" , "shawnguo@kernel.org" , "LW@KARO-electronics.de" , "linux-pm@vger.kernel.org" , "devicetree@vger.kernel.org" , "linux-kernel@vger.kernel.org" , "linux-arm-kernel@lists.infradead.org" CC: dl-linux-imx Subject: [PATCH V4 4/4] ARM64: dts: imx: add i.MX8QXP thermal support Thread-Topic: [PATCH V4 4/4] ARM64: dts: imx: add i.MX8QXP thermal support Thread-Index: AQHUh4yD0j4a4gnKUE+WHik1QQ7rHA== Date: Thu, 29 Nov 2018 02:37:47 +0000 Message-ID: <1543458696-4741-5-git-send-email-Anson.Huang@nxp.com> References: <1543458696-4741-1-git-send-email-Anson.Huang@nxp.com> In-Reply-To: <1543458696-4741-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: HK0PR04CA0011.apcprd04.prod.outlook.com (2603:1096:203:36::23) 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-microsoft-exchange-diagnostics: 1;DB3PR0402MB3946;6:sV5rp+2oQ7B66b68LU+k8rZXoZzioTf/uKgwVdvGVb1c1XJQod5gIF0vSDwBOiBcdKRhRKTFfhQWb4xI5v3JgWPTYEch9U4r3sc5iZRGzN84EyJNNrU2YHZYKsnThA1d+/vRdb3yOi883IxFmJelJUAIUpsXHRGA6fYwQVqYZYfBSpHJ1DtaZS/ctP8ogVBfg5xxmbYyqgUGhYnPJ9x+zY2QZBdSpD3GAYHMtO0Vo8I5vElABF6VrF1EApQguX55eEj/jOn3KYiLXf7fcfbjHIYElFoZL+msEDMcatjK+ij86hMF3lUPKJ8sd62lASqEPJV7+f8VtZQzAH4+GF0fqasRLcEZNaAlKsyw2MeYQvqoN8rR7M5GY5rTJ1zuOHwi7fXR9zqzJ5lxxspOUaC3eZqJJEcVZNNP/yqOVRD+TLZmVRFWisUeB6SLvgPsXUMEFFZCHarp4ksEgV7YaHDwpg==;5:GwKOKIlFL8vJZ9uxrP42s0ltPOi8b9bHHuxHyvhqx84AY0ejEv3hWWDLxYbd4azM7jw2zBWPvOVpkOMJ7hLKLBlT66PV1r2VHa0vxNUOp6vYyIERad+GUzo+X4nUVQlBvWDS3sOH5ipfm2iYlA5+TxKao0dhpCrSqqdwidAycKU=;7:dDFQsfwTTTf7ciNgKG9TtCahdcuf3EQKoU7E+3I4PNHozNKexAwyr+R1hXeQ4fEy9TC4m/hivLQT891j/UUfFGeRcrsJHxJzOTlH5e0+2+n0vhOv87VcpVCvsIkq+viyK2wFYeKTYUdBjNvW9K/fNg== x-ms-office365-filtering-correlation-id: 91b193a0-84ff-4d50-521d-08d655a3a636 x-ms-office365-filtering-ht: Tenant x-microsoft-antispam: BCL:0;PCL:0;RULEID:(2390098)(7020095)(4652040)(8989299)(5600074)(711020)(4618075)(4534185)(4627221)(201703031133081)(201702281549075)(8990200)(2017052603328)(7153060)(7193020);SRVR:DB3PR0402MB3946; x-ms-traffictypediagnostic: DB3PR0402MB3946: x-ld-processed: 686ea1d3-bc2b-4c6f-a92c-d99c5c301635,ExtAddr x-microsoft-antispam-prvs: x-ms-exchange-senderadcheck: 1 x-exchange-antispam-report-cfa-test: BCL:0;PCL:0;RULEID:(8211001083)(6040522)(2401047)(5005006)(8121501046)(3231453)(999002)(944501410)(52105112)(93006095)(93001095)(3002001)(10201501046)(6055026)(148016)(149066)(150057)(6041310)(20161123560045)(20161123562045)(20161123558120)(20161123564045)(201703131423095)(201702281528075)(20161123555045)(201703061421075)(201703061406153)(201708071742011)(7699051)(76991095);SRVR:DB3PR0402MB3946;BCL:0;PCL:0;RULEID:;SRVR:DB3PR0402MB3946; x-forefront-prvs: 0871917CDA x-forefront-antispam-report: SFV:NSPM;SFS:(10009020)(346002)(39860400002)(376002)(396003)(136003)(366004)(54534003)(199004)(189003)(25786009)(50226002)(99286004)(3846002)(6116002)(478600001)(8936002)(76176011)(14454004)(2201001)(52116002)(316002)(102836004)(106356001)(86362001)(110136005)(186003)(2906002)(26005)(81166006)(81156014)(8676002)(386003)(6506007)(68736007)(6512007)(7736002)(6486002)(6436002)(4326008)(66066001)(71190400001)(53936002)(39060400002)(36756003)(2501003)(71200400001)(305945005)(256004)(97736004)(105586002)(486006)(11346002)(446003)(2616005)(476003)(7416002)(5660300001)(921003)(1121003);DIR:OUT;SFP:1101;SCL:1;SRVR:DB3PR0402MB3946;H:DB3PR0402MB3916.eurprd04.prod.outlook.com;FPR:;SPF:None;LANG:en;PTR:InfoNoRecords;A:1;MX:1; received-spf: None (protection.outlook.com: nxp.com does not designate permitted sender hosts) x-microsoft-antispam-message-info: n13gfGD4ATH/E1FQHnU6YqhJWepU3mgQ+2apN5ulkEPfZ4EHxOw9cI6GrG+nrxNQ2nngolQkXZ6GmveGFRfNk9NMAqLx7ndVUrHhtxTF/Cc6XwSfPRUkHVfPpuKyfhoG4knpMIu5Cbj4bOWpH0uFZuEtLh7wZUigexDpwBbxn61Ux19uimMF8kiyvji6/2KmygmdldNS7Cya0/KQT3++Dlf4WZfdD/w/RuFm6oZU5U+L+PMIQfLRBS7rFWaReqszqvrHNeMOToUZO2oUYbyuj6AJSXLt8oChnbYVxa4w6bin/0Iy46fRc80rfucCiC6Hp2ZkqDbQu2xA1jsblRC8oV7IKS5L5lacTwBrvX2CkQY= spamdiagnosticoutput: 1:99 spamdiagnosticmetadata: NSPM MIME-Version: 1.0 X-OriginatorOrg: nxp.com X-MS-Exchange-CrossTenant-Network-Message-Id: 91b193a0-84ff-4d50-521d-08d655a3a636 X-MS-Exchange-CrossTenant-originalarrivaltime: 29 Nov 2018 02:37:47.8924 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: 686ea1d3-bc2b-4c6f-a92c-d99c5c301635 X-MS-Exchange-Transport-CrossTenantHeadersStamped: DB3PR0402MB3946 Sender: linux-pm-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-pm@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP Add i.MX8QXP CPU thermal zone support. Signed-off-by: Anson Huang --- ChangeLog: V3->V4: *move the tsens node to inside of SCU node as it is belonging to SCU. --- arch/arm64/boot/dts/freescale/imx8qxp.dtsi | 27 +++++++++++++++++++++++++++ 1 file changed, 27 insertions(+) diff --git a/arch/arm64/boot/dts/freescale/imx8qxp.dtsi b/arch/arm64/boot/dts/freescale/imx8qxp.dtsi index 9b08688..48f622c 100644 --- a/arch/arm64/boot/dts/freescale/imx8qxp.dtsi +++ b/arch/arm64/boot/dts/freescale/imx8qxp.dtsi @@ -9,6 +9,7 @@ #include #include #include +#include #include "imx8-ca35.dtsi" @@ -87,6 +88,12 @@ rtc: rtc { compatible = "fsl,imx8qxp-sc-rtc"; }; + + tsens: thermal-sensor { + compatible = "fsl,imx8qxp-sc-thermal"; + tsens-num = <1>; + #thermal-sensor-cells = <1>; + }; }; adma_subsys: bus@59000000 { @@ -410,4 +417,24 @@ #size-cells = <1>; ranges = <0x5f000000 0x0 0x5f000000 0x1000000>; }; + + thermal_zones: thermal-zones { + cpu-thermal0 { + polling-delay-passive = <250>; + polling-delay = <2000>; + thermal-sensors = <&tsens 355>; + trips { + cpu_alert0: trip0 { + temperature = <107000>; + hysteresis = <2000>; + type = "passive"; + }; + cpu_crit0: trip1 { + temperature = <127000>; + hysteresis = <2000>; + type = "critical"; + }; + }; + }; + }; };