From patchwork Thu Feb 7 09:52:37 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Anson Huang X-Patchwork-Id: 10800699 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 295A31575 for ; Thu, 7 Feb 2019 10:07:43 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 152042D127 for ; Thu, 7 Feb 2019 10:07:43 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 07D8B2D15D; Thu, 7 Feb 2019 10:07:43 +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=-5.2 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,MAILING_LIST_MULTI,RCVD_IN_DNSWL_MED autolearn=ham version=3.3.1 Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id 990FD2D127 for ; Thu, 7 Feb 2019 10:07:42 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20170209; h=Sender: Content-Transfer-Encoding:Content-Type:Cc:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:Message-ID:Date:Subject:To :From:Reply-To:Content-ID:Content-Description:Resent-Date:Resent-From: Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:In-Reply-To:References: List-Owner; bh=Zwakj6JCWjZS0t7BXd/fXQ+mj65zae9t0M7RDxaAc4U=; b=L/KQw2AcRC/HF/ 9FVTim/BPsEoF5dM66JiK68Hb5HWa7sYuFBNtQx29apGkPiJZ5W/6x3IL3LJNTX4unDYwc960q6oY ZcRvvgFXoKKAiEucSsWm4vnX5YvRN/rTLj2FayiZV5nm4gI5/01LN0Yl0wxREk4LYTfmsYiJQ3g7p ozjD8oJhYvG6GsJD+fHOpmPEGjGJ3x16uKCQHazWO1/XVedulDMSq80nNbgbbPE87aX7zn7n9NH18 DRxJZ+GXqYlG0JclB0Tzwrc9lqFFQ0vdzsfswv0OjwF08f/wDSr7Uop7kffasireSDZyFU2mrL3W7 ZN2uJ230nTXNNsJQ07qw==; Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.90_1 #2 (Red Hat Linux)) id 1grgao-0000ig-4K; Thu, 07 Feb 2019 10:07:38 +0000 Received: from casper.infradead.org ([2001:8b0:10b:1236::1]) by bombadil.infradead.org with esmtps (Exim 4.90_1 #2 (Red Hat Linux)) id 1grgaL-0008HE-Vs for linux-arm-kernel@bombadil.infradead.org; Thu, 07 Feb 2019 10:07:10 +0000 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=casper.20170209; h=MIME-Version:Content-Transfer-Encoding: Content-Type:Message-ID:Date:Subject:CC:To:From:Sender:Reply-To:Content-ID: Content-Description:Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc :Resent-Message-ID:In-Reply-To:References:List-Id:List-Help:List-Unsubscribe: List-Subscribe:List-Post:List-Owner:List-Archive; bh=lcm5ZlTwO5wdHB/lVH6FfmYaGpNpwLQ3C2M5tTV98f8=; b=XUUDFDYg0nmu/QKt0B4g/8UF99 OLIi+8nN1uIsy9GUqar4LFddxIhBC2u4BJIqiJCMLXgbqXUcRQ3ezhfhOHkCZa4fY92klvHYw3jWX hg7snej7AXk+eWlK/xqr4Haoyb7p9LFzTBtlx/EzueYHNHrO94qGF4e8uy001zUTuyxld4d1eq2tx hzkMd8GcvSUi6F+rERlKj7l18QIXU8Dx2nUkzdrgnDUQS0VKvM5bVZ0eFLw0qZOypl7SjmEBxx/25 G0pgQlGMh/JRNC3V8Tkz2b2fi20Cuy9SCxt/LZSqttv0DhNitIjw6R7Hu0hXS9bfQD6Esb2r+RyUO ltQNM9vw==; Received: from mail-eopbgr10050.outbound.protection.outlook.com ([40.107.1.50] helo=EUR02-HE1-obe.outbound.protection.outlook.com) by casper.infradead.org with esmtps (Exim 4.90_1 #2 (Red Hat Linux)) id 1grgMN-0007m1-Rx for linux-arm-kernel@lists.infradead.org; Thu, 07 Feb 2019 09:52:46 +0000 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=lcm5ZlTwO5wdHB/lVH6FfmYaGpNpwLQ3C2M5tTV98f8=; b=CHN9rPZ9kDDqLwgHlSaMthocayDXQkJ21/WYaC4YhdWpiUwvDyMAldA8OG27XK6Xci85QjN3m3srvK4l9FajqHzTWMutCh9by0VntB3stQP2Nea1v+vNHW8kTCKrr8z2GpJFZI3XI+tes0ERtu5ByWRYBt0k1No1hLWCOrHPEt4= Received: from AM6PR0402MB3911.eurprd04.prod.outlook.com (52.133.30.10) by AM6PR0402MB3589.eurprd04.prod.outlook.com (52.133.20.14) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.1601.21; Thu, 7 Feb 2019 09:52:38 +0000 Received: from AM6PR0402MB3911.eurprd04.prod.outlook.com ([fe80::6c94:4ad8:e9f3:cf1]) by AM6PR0402MB3911.eurprd04.prod.outlook.com ([fe80::6c94:4ad8:e9f3:cf1%4]) with mapi id 15.20.1601.016; Thu, 7 Feb 2019 09:52:38 +0000 From: Anson Huang To: "robh+dt@kernel.org" , "mark.rutland@arm.com" , "shawnguo@kernel.org" , "s.hauer@pengutronix.de" , "kernel@pengutronix.de" , "festevam@gmail.com" , "catalin.marinas@arm.com" , "will.deacon@arm.com" , "rui.zhang@intel.com" , "edubezval@gmail.com" , "daniel.lezcano@linaro.org" , Aisheng Dong , "ulf.hansson@linaro.org" , Daniel Baluta , "horms+renesas@verge.net.au" , Andy Gross , "heiko@sntech.de" , "arnd@arndb.de" , "maxime.ripard@bootlin.com" , "jagan@amarulasolutions.com" , "bjorn.andersson@linaro.org" , "enric.balletbo@collabora.com" , "marc.w.gonzalez@free.fr" , "olof@lixom.net" , "devicetree@vger.kernel.org" , "linux-kernel@vger.kernel.org" , "linux-arm-kernel@lists.infradead.org" , "linux-pm@vger.kernel.org" Subject: [PATCH V6 1/4] dt-bindings: fsl: scu: add thermal binding Thread-Topic: [PATCH V6 1/4] dt-bindings: fsl: scu: add thermal binding Thread-Index: AQHUvsrbmfXgtz1KZEeItOtlZ1aFAg== Date: Thu, 7 Feb 2019 09:52:37 +0000 Message-ID: <1549532838-27025-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: HK2PR02CA0190.apcprd02.prod.outlook.com (2603:1096:201:21::26) To AM6PR0402MB3911.eurprd04.prod.outlook.com (2603:10a6:209:1c::10) 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; AM6PR0402MB3589; 6:JIFkyQTlIX39VKAk5yWZtZVY7KA/TaGA+Bh6uErlIQy1Wl5rD3cnK2MNpzoyoYvzepoEACL83qSY3qWlFZxzg41iNDJD1Twz7LVGKlnIQ6WyQVeELyD8xaqTLnfrOheFvy+h0nJcXU4I5DeOo4uVloEJlKiUn96zzr4ZQfxtqY12+ParvDQt/9bxIm5q+9N8W91rvBArVYl0opzw8ZPOPsqooQZ5RIOi6omJUx9awm3hfJZOydaeoaJxrBlh6BFLMG8eUBBqWbAyXvR++uY88jTknc5PIr79ppg0oE8GqPJCKjROhpkt91IinIunOEF0P7h3KPfAIhqvtvbOZCGvf7xZXMyTVSgbH9JdGdP/JGgyGfVl7zr4Z65Koup7rG/PyuZeLbOkjXXi4tRtwQGDK8reD9jXe9yKqblZ1Om8TZxVdpzKfQ3LzNN7VNS4he7eeA6iyDrlSROSHd4abaNO4w==; 5:hKDkY7jhxPBoJn8aef+4JcfJQM/V1mv2smGGRJiaWOJA6NHkZ/A+LYxWyCjtB5rmavxx21FCgXXBkQjN0IRqXoqzQ+dPr6TmYtedJ4xf8UFjw626SqRK1Sn/JH1qJ5dkIDxHxMbltKfYtU+mdqw0c4MjaQbuMxRKQFRvFfh+25I9/pMrKk8DxORDbzNwMB0SIN8bvxQcIj25ddmsEhr8SQ==; 7:GhJAyFmMuvsN4hN9+ODB6kgJT1L9FDw3nd/XDkz3Lc981PuJV8moiKnTS4hTlw/4FQNxaBFmf+JUoR5GAJDO6k/ONLp2EHdBMDV/wUn/K4R+XgF1i8/xSMm71cSeOdGU9R5XZfZOG2kVzDRD/5+SBA== x-ms-office365-filtering-correlation-id: c01e64f1-e2b4-4f80-4528-08d68ce1fdd0 x-ms-office365-filtering-ht: Tenant x-microsoft-antispam: BCL:0; PCL:0; RULEID:(2390118)(7020095)(4652040)(8989299)(4534185)(4627221)(201703031133081)(201702281549075)(8990200)(5600110)(711020)(4605077)(4618075)(2017052603328)(7153060)(7193020); SRVR:AM6PR0402MB3589; x-ms-traffictypediagnostic: AM6PR0402MB3589: x-ld-processed: 686ea1d3-bc2b-4c6f-a92c-d99c5c301635,ExtAddr x-microsoft-antispam-prvs: x-forefront-prvs: 0941B96580 x-forefront-antispam-report: SFV:NSPM; SFS:(10009020)(396003)(136003)(366004)(39860400002)(346002)(376002)(54534003)(189003)(199004)(106356001)(36756003)(2201001)(81156014)(8936002)(86362001)(4326008)(6116002)(71200400001)(81166006)(256004)(6512007)(71190400001)(66066001)(53936002)(105586002)(8676002)(68736007)(386003)(6506007)(97736004)(476003)(3846002)(486006)(14454004)(7416002)(50226002)(2616005)(478600001)(6486002)(25786009)(186003)(26005)(6436002)(99286004)(316002)(110136005)(7736002)(305945005)(2501003)(102836004)(52116002)(2906002)(921003)(1121003); DIR:OUT; SFP:1101; SCL:1; SRVR:AM6PR0402MB3589; H:AM6PR0402MB3911.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: er8HVtngzUtySUJ0xH+t4VPq5Uomh39tU/KDEvszrOJMIkwsTdw+ValULYczGsyyBuUgi+oj4PLxN0IxfI7Jfh8WHpPlPd1X/ksvln9zMg6AmKq9bYItH1TrVmBpS9X9Di+wrlv/eOWeYs++nh/g63xfbWoOX7+FaC/WNdmbqRQQDdRhYte+retNUqaiXC1MqIuU4e446WGvak9fAVsOS6X+A6KKKX3+KDKMulvpzrn0wvdqheJkVCGR9kCVLx63a3qwaNbh6T/CplmIVW7RT/I7DpsQoEE+VjvzLs0e8mxabd0oU1WqcgkP+CnzXzM0DzkJmgQERAdZ96M26D6il++AbPr3veMJt9STupRUe/jjc0kvC2GHFe23XPuGNq5Eyjirj5IOp9AOsC5VC9d0cBLpHoDPtdduG278DVBdJmw= MIME-Version: 1.0 X-OriginatorOrg: nxp.com X-MS-Exchange-CrossTenant-Network-Message-Id: c01e64f1-e2b4-4f80-4528-08d68ce1fdd0 X-MS-Exchange-CrossTenant-originalarrivaltime: 07 Feb 2019 09:52:28.9999 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-mailboxtype: HOSTED X-MS-Exchange-CrossTenant-id: 686ea1d3-bc2b-4c6f-a92c-d99c5c301635 X-MS-Exchange-Transport-CrossTenantHeadersStamped: AM6PR0402MB3589 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20190207_095243_974569_AF7CF444 X-CRM114-Status: GOOD ( 13.51 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: dl-linux-imx Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.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 since V5: - add "imx,sensor-resource-id" in each thermal zone to pass resource ID for thermal driver. --- .../devicetree/bindings/arm/freescale/fsl,scu.txt | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) diff --git a/Documentation/devicetree/bindings/arm/freescale/fsl,scu.txt b/Documentation/devicetree/bindings/arm/freescale/fsl,scu.txt index 72d481c..4b79751 100644 --- a/Documentation/devicetree/bindings/arm/freescale/fsl,scu.txt +++ b/Documentation/devicetree/bindings/arm/freescale/fsl,scu.txt @@ -122,6 +122,20 @@ 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. +- imx,sensor-resource-id : This property should be defined in each thermal zone + of thermal-zones node, it passes each thermal zone's + resource id for thermal driver to get temperature via + SCU IPC. + Example (imx8qxp): ------------- lsio_mu1: mailbox@5d1c0000 { @@ -168,6 +182,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 Feb 7 09:52:46 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Anson Huang X-Patchwork-Id: 10800685 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 B26981823 for ; Thu, 7 Feb 2019 09:53:32 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 9C8992CE35 for ; Thu, 7 Feb 2019 09:53:32 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 906492CE56; Thu, 7 Feb 2019 09:53:32 +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=-5.2 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,MAILING_LIST_MULTI,RCVD_IN_DNSWL_MED autolearn=ham version=3.3.1 Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id CDF602CE52 for ; Thu, 7 Feb 2019 09:53:31 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20170209; h=Sender: Content-Transfer-Encoding:Content-Type:Cc:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:In-Reply-To:References: Message-ID:Date:Subject:To:From:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=2gJKdmlYdb5Lk3NyBmhUGxYZpVWMK0215V/XO12aUlY=; b=hNYTtiBbvS8W5w W79yV3Feu3gNT6AsACL3kHfSKt1TsAzqVI2xw+i7QOKQbs0ZEtaKt535bm5qwo5DyaHzGzYT2/N/P ZM/HGxyCQ4ysIYdGODG6zjDX6oYBqimF9nLNBMgHIuBtBgpJ6kCiJJDnEThu0BKdwiU/+1kc4e038 xSGVHu6cAWvwXyCwyGeVO8PXCnApxO6SGegi84zoh3Z3wzhpd8RnMeWUD0KZaAl+GbqQncvkq+uyZ kKIS0KYdMxotxbnX7Ul4lWND6DTQkbmLjsbHTxA3hU6+/4CazXZ0O2zh5A+JPdzeNKJthiyB3o7Gh Kyt6i936zp36oKYnfhHw==; Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.90_1 #2 (Red Hat Linux)) id 1grgN7-0001Lf-9C; Thu, 07 Feb 2019 09:53:29 +0000 Received: from mail-eopbgr40069.outbound.protection.outlook.com ([40.107.4.69] helo=EUR03-DB5-obe.outbound.protection.outlook.com) by bombadil.infradead.org with esmtps (Exim 4.90_1 #2 (Red Hat Linux)) id 1grgMW-0000g8-LG for linux-arm-kernel@lists.infradead.org; Thu, 07 Feb 2019 09:53:26 +0000 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=aBCVcyuHI8F17nhIew6FC+NgAS8LkLo3yvFiZ3gRV+4=; b=TdjGdZhSnZxTFms1Z2SzT0rnlX3WGskP2JoFouj4kS+qqFqLNuEyxZhK1Q1TAxfJ5zlLxfEuWrSil0+z85oy5hQukaCleMc1g1w+0w5Ck8D/hz+bbEv7lPqlfq8ItSmUtJd27vqBUUVxDSGAIIhJe1PiBjJ5KCgnsbfSorCqrx4= Received: from AM6PR0402MB3911.eurprd04.prod.outlook.com (52.133.30.10) by AM6PR0402MB3702.eurprd04.prod.outlook.com (52.133.28.157) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.1601.17; Thu, 7 Feb 2019 09:52:47 +0000 Received: from AM6PR0402MB3911.eurprd04.prod.outlook.com ([fe80::6c94:4ad8:e9f3:cf1]) by AM6PR0402MB3911.eurprd04.prod.outlook.com ([fe80::6c94:4ad8:e9f3:cf1%4]) with mapi id 15.20.1601.016; Thu, 7 Feb 2019 09:52:47 +0000 From: Anson Huang To: "robh+dt@kernel.org" , "mark.rutland@arm.com" , "shawnguo@kernel.org" , "s.hauer@pengutronix.de" , "kernel@pengutronix.de" , "festevam@gmail.com" , "catalin.marinas@arm.com" , "will.deacon@arm.com" , "rui.zhang@intel.com" , "edubezval@gmail.com" , "daniel.lezcano@linaro.org" , Aisheng Dong , "ulf.hansson@linaro.org" , Daniel Baluta , "horms+renesas@verge.net.au" , Andy Gross , "heiko@sntech.de" , "arnd@arndb.de" , "maxime.ripard@bootlin.com" , "jagan@amarulasolutions.com" , "bjorn.andersson@linaro.org" , "enric.balletbo@collabora.com" , "marc.w.gonzalez@free.fr" , "olof@lixom.net" , "devicetree@vger.kernel.org" , "linux-kernel@vger.kernel.org" , "linux-arm-kernel@lists.infradead.org" , "linux-pm@vger.kernel.org" Subject: [PATCH V6 2/4] thermal: imx_sc: add i.MX system controller thermal support Thread-Topic: [PATCH V6 2/4] thermal: imx_sc: add i.MX system controller thermal support Thread-Index: AQHUvsrh/bRpd0a7WkiScdELFst3Yg== Date: Thu, 7 Feb 2019 09:52:46 +0000 Message-ID: <1549532838-27025-2-git-send-email-Anson.Huang@nxp.com> References: <1549532838-27025-1-git-send-email-Anson.Huang@nxp.com> In-Reply-To: <1549532838-27025-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: HK2PR02CA0190.apcprd02.prod.outlook.com (2603:1096:201:21::26) To AM6PR0402MB3911.eurprd04.prod.outlook.com (2603:10a6:209:1c::10) 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; AM6PR0402MB3702; 6:hxLIwiM47xFJe4FqXgvMhQpWuHjHzRaz5Ag3McCmHL3G/jGHUFOnsJJDnOw1jP4+zRUFW8wj67NfurBC5dOvPgFCpS91wkhod2Ra+zZU8vjec80PosGqtGcSfUiyo4sBFDkWIM3jPao/GVqhP6gIp/v0dtECKhl6mVhEgtz1kVZJ9n7Xgkm+dAzeMCLPr82yoVQuts+rbgDXf72wbZ8Q4ky7FOKbf8NTo+zN6uXGQyY7t5ZMrwdwqPC7yG6KMeRlVUA7Q4sBhePI5rDeqOCSeKh6uz44JMzi1kp2CwEwjbgscEZrOWnLVvGxiB7Qsarn+ydC6ABkxnjhTQ79Es61vtXPC+vZS7zgXdbn9RDV9x6prXI2ukHNKkQLfZLwVdrOohpjIiYUEFPRFWdhUhtA3G1xtINgVc96C4LYMYb7dp3SyTdNP9Uu1QHzUAk8HYsFe3TUlrTQ1Va6oOQP9YNdgA==; 5:asd2s+QWkpzYogw9k/SQT3bKHkX9W81JdzXhRhkSO7veORs26HUoxA4aML4/20JPxVua7hvGvRg4RtrZ+kuoGDyHCf8NyLXAn6nocINsqFIyfXA5XgYhiJYwqxxpRuri+uRQNLxitmCXznnfsxas01klJ/c2GrGdhKVS8M0IALd77kMzAs43XzzCGyFpT44avCNPFeLUWdQ5td92coVlww==; 7:R6HZThVfkDZsudf8TxRQTJ5W77NazxPAlOgXpPmZHkJ5uoMVyhMYbB9ACutmkcxR1846z1eIod09E+JGIKuC4yrEy3jyFm6u6knNnPtnmOoCEWyYVTersYneb/aK+pQmQazCcV5cabQlj1yB1/vYFg== x-ms-office365-filtering-correlation-id: 37f8de90-f91b-441b-e3b3-08d68ce2035b x-ms-office365-filtering-ht: Tenant x-microsoft-antispam: BCL:0; PCL:0; RULEID:(2390118)(7020095)(4652040)(8989299)(4534185)(4627221)(201703031133081)(201702281549075)(8990200)(5600110)(711020)(4605077)(4618075)(2017052603328)(7153060)(7193020); SRVR:AM6PR0402MB3702; x-ms-traffictypediagnostic: AM6PR0402MB3702: x-ld-processed: 686ea1d3-bc2b-4c6f-a92c-d99c5c301635,ExtAddr x-microsoft-antispam-prvs: x-forefront-prvs: 0941B96580 x-forefront-antispam-report: SFV:NSPM; SFS:(10009020)(366004)(376002)(39860400002)(396003)(136003)(346002)(199004)(189003)(54534003)(386003)(66066001)(97736004)(316002)(6506007)(26005)(7416002)(102836004)(110136005)(86362001)(71190400001)(52116002)(68736007)(71200400001)(99286004)(36756003)(2201001)(76176011)(6436002)(6116002)(53936002)(25786009)(256004)(478600001)(3846002)(476003)(446003)(81156014)(8676002)(11346002)(81166006)(50226002)(2616005)(6512007)(486006)(305945005)(7736002)(2906002)(8936002)(186003)(106356001)(2501003)(105586002)(4326008)(14454004)(6486002)(921003)(1121003); DIR:OUT; SFP:1101; SCL:1; SRVR:AM6PR0402MB3702; H:AM6PR0402MB3911.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-ms-exchange-senderadcheck: 1 x-microsoft-antispam-message-info: BJoHsyqYYwC+yjOk9j3k0RVqXFp2DLybfRvlv1TtR39h3G+bZoOLDKFSiIJsGf2OYwOCldsjG6JtVPx2BPj5An2nYTPaDzx7ng2TlDTxa+foKIcblDxYho4eeD7RV/ptAVSETFDpNg/dljHsbJuEGx4wso6thUXEjLWpz0PKBEmV+z55II5xtX78RPEjAK4kar6uhd+kE5Ph81ImeQaFD9Fd4RpeN9eDeNyoHrNZ8xuhFfGdOJFbFqs8YuNbZzLg61LV0A10bdA2tUnN+q7BJccg1swc8a4WT2OaE6IY6Ishr2hyBDW+RPpgS952p8sxO/Ufynm1PN5BQFgHAqhrktn1lyUUaPRy2R6pcAW0Ye085fanJCUZ8UaJACZb4tRnnD1eeXDGBJ3ewfoU3kgj6LF7KuX0VcjJPw8/ZdAWxyg= MIME-Version: 1.0 X-OriginatorOrg: nxp.com X-MS-Exchange-CrossTenant-Network-Message-Id: 37f8de90-f91b-441b-e3b3-08d68ce2035b X-MS-Exchange-CrossTenant-originalarrivaltime: 07 Feb 2019 09:52:38.3236 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-mailboxtype: HOSTED X-MS-Exchange-CrossTenant-id: 686ea1d3-bc2b-4c6f-a92c-d99c5c301635 X-MS-Exchange-Transport-CrossTenantHeadersStamped: AM6PR0402MB3702 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20190207_015252_951524_AAEFD71D X-CRM114-Status: GOOD ( 19.60 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: dl-linux-imx Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.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 since V5: - instead of abusing common thermal sensor ID, add a property in each thermal zone to pass resource id to thermal driver. --- drivers/thermal/Kconfig | 11 +++ drivers/thermal/Makefile | 1 + drivers/thermal/imx_sc_thermal.c | 161 +++++++++++++++++++++++++++++++++++++++ 3 files changed, 173 insertions(+) create mode 100644 drivers/thermal/imx_sc_thermal.c diff --git a/drivers/thermal/Kconfig b/drivers/thermal/Kconfig index 58bb7d7..fec0ef5 100644 --- a/drivers/thermal/Kconfig +++ b/drivers/thermal/Kconfig @@ -223,6 +223,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 && IMX_SCU) || 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 486d682..4062627 100644 --- a/drivers/thermal/Makefile +++ b/drivers/thermal/Makefile @@ -40,6 +40,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..fc0bb7e --- /dev/null +++ b/drivers/thermal/imx_sc_thermal.c @@ -0,0 +1,161 @@ +// SPDX-License-Identifier: GPL-2.0+ +/* + * Copyright 2018-2019 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_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) + 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 = of_property_read_u32(sensor_np, "imx,sensor-resource-id", + &sensor->resource_id); + if (ret) { + dev_err(&pdev->dev, + "failed to get valid sensor resource id: %d\n", + ret); + break; + } + + sensor->tzd = devm_thermal_zone_of_sensor_register(&pdev->dev, + i, + sensor, + &imx_sc_thermal_ops); + if (IS_ERR(sensor->tzd)) { + dev_err(&pdev->dev, "failed to register thermal zone\n"); + ret = PTR_ERR(sensor->tzd); + 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 Feb 7 09:52:56 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Anson Huang X-Patchwork-Id: 10800691 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 5CC7F6C2 for ; Thu, 7 Feb 2019 09:53:46 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 4A3982CE35 for ; Thu, 7 Feb 2019 09:53:46 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 3D9592CE56; Thu, 7 Feb 2019 09:53:46 +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=-5.2 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,MAILING_LIST_MULTI,RCVD_IN_DNSWL_MED autolearn=ham version=3.3.1 Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id E1F002CE35 for ; Thu, 7 Feb 2019 09:53:45 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20170209; h=Sender: Content-Transfer-Encoding:Content-Type:Cc:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:In-Reply-To:References: Message-ID:Date:Subject:To:From:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=zuLbOs44v+bapS/0MKHcyXeuS1Bk7iMcv/C3ODm1p5I=; b=CPDr/KZNcNMcF3 h7B6HrgJVul3t38xnxbgPby7oKurT0Mq2AJuMllQa+BKg6gqvOlZ2ncJ8EZydLqMjB0wwiMwGh7O2 3B7TCgdQq1j2JMxJVZ6fzrDfOuHfIzlIOfpuNJbKCsZ67Qw7N5MLUYzqmQ+pyKdz3K8CX36RVWUx+ j8pjjoHik41J2JEdsXiEYS42/sbkeQGCaDLYOuXQ6jpGLLvplGje25rrl8CFTxm8j/dYs4BaVVv87 EVQFpQ0rPePHRIkz9SIspouMRa7qy9vCBT3F2tAcBR0wMIa2Y9IDMWlJbfE6IepS4zHEhrY50vXcl GdxNqU4VjC+j5539ruyg==; Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.90_1 #2 (Red Hat Linux)) id 1grgNL-0001a6-Jw; Thu, 07 Feb 2019 09:53:43 +0000 Received: from mail-eopbgr10049.outbound.protection.outlook.com ([40.107.1.49] helo=EUR02-HE1-obe.outbound.protection.outlook.com) by bombadil.infradead.org with esmtps (Exim 4.90_1 #2 (Red Hat Linux)) id 1grgMf-0000qC-N9 for linux-arm-kernel@lists.infradead.org; Thu, 07 Feb 2019 09:53:28 +0000 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=RhUC3abvwGYFLAR6Z1SdcCkflQuJQgBUuu+D0CmmWlk=; b=DvWdEsxOD0gcviNDXYMS6O+GuWAFkAJgcX/WYmrI5LzFwkeAwWuJcQJAChykHn1qoqUTke2hVo7jVpUcFaT5qi6nk0pv911bERgLglz/5AwFLfx4gf906ySooRgGdg7++HvqU/6/QBqDBDJ1Ac80jQPqNAkzX3Q41cTgv013t8o= Received: from AM6PR0402MB3911.eurprd04.prod.outlook.com (52.133.30.10) by AM6PR0402MB3589.eurprd04.prod.outlook.com (52.133.20.14) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.1601.21; Thu, 7 Feb 2019 09:52:56 +0000 Received: from AM6PR0402MB3911.eurprd04.prod.outlook.com ([fe80::6c94:4ad8:e9f3:cf1]) by AM6PR0402MB3911.eurprd04.prod.outlook.com ([fe80::6c94:4ad8:e9f3:cf1%4]) with mapi id 15.20.1601.016; Thu, 7 Feb 2019 09:52:56 +0000 From: Anson Huang To: "robh+dt@kernel.org" , "mark.rutland@arm.com" , "shawnguo@kernel.org" , "s.hauer@pengutronix.de" , "kernel@pengutronix.de" , "festevam@gmail.com" , "catalin.marinas@arm.com" , "will.deacon@arm.com" , "rui.zhang@intel.com" , "edubezval@gmail.com" , "daniel.lezcano@linaro.org" , Aisheng Dong , "ulf.hansson@linaro.org" , Daniel Baluta , "horms+renesas@verge.net.au" , Andy Gross , "heiko@sntech.de" , "arnd@arndb.de" , "maxime.ripard@bootlin.com" , "jagan@amarulasolutions.com" , "bjorn.andersson@linaro.org" , "enric.balletbo@collabora.com" , "marc.w.gonzalez@free.fr" , "olof@lixom.net" , "devicetree@vger.kernel.org" , "linux-kernel@vger.kernel.org" , "linux-arm-kernel@lists.infradead.org" , "linux-pm@vger.kernel.org" Subject: [PATCH V6 3/4] defconfig: arm64: add i.MX system controller thermal support Thread-Topic: [PATCH V6 3/4] defconfig: arm64: add i.MX system controller thermal support Thread-Index: AQHUvsrmy7YFR5pP8E6Q+nykG2OIww== Date: Thu, 7 Feb 2019 09:52:56 +0000 Message-ID: <1549532838-27025-3-git-send-email-Anson.Huang@nxp.com> References: <1549532838-27025-1-git-send-email-Anson.Huang@nxp.com> In-Reply-To: <1549532838-27025-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: HK2PR02CA0190.apcprd02.prod.outlook.com (2603:1096:201:21::26) To AM6PR0402MB3911.eurprd04.prod.outlook.com (2603:10a6:209:1c::10) 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; AM6PR0402MB3589; 6:y3J3Z+xvUWE+gUbENJlXv2RQDvRMkQ1132nxvKwJ/RVGpnqZmrp63A1WqfaukFP8hSH6t/03E2/w+ee0lWdvDnq+QDmJwVBf8uUVcAVOCvfZYvHW1UjNNX3AGGxufhvIpFANj5msEhlpoAG7jXP6dNs/FH48ohIox5XnYNP3Y1/q42FWj9cqpEoNdgs61sYNFlmb2ZBsCZz24o1o6hoyoNsfJ2izJnQOAwQD+Bf34tEPyN1KmMXlSuWyLbS6WH9aNovGKZ/pnf8ecsjhocF6mzCaQ3Mi6Islc1WwdKKAL+N1MVs69c4vpD+qpMAsfbYNmUSuxSg9JfTU0rjqwSZY0q55T7inxEroaVsX9BZHcQHMSUyWNJ8drg8nICr5VN6r/cMQlRyZukY6RxSfFRc+C58xeWsnr7Zd0I5OV8fwzuIfT2VonPliPcCveTP96jSXIXzspsB4aP36Kx89ncEezA==; 5:er1FCl7+BcGXOfgsYQPMNQi5RnpeoZIviWggXzF91S1S+ikagT8OP0zO/9XLXjN165+a3wB6Bl+FAVzP3X4Or2vUfGaUF423PIzZM5ngFlrzzvGTcUVOyisSSY6eITGSozdh2lGXAsXrWk/ppugf6GanG/mCXGaDXEJlynG+zr0mbqEbJaRj6NmVnXx21FsNcJ1YVi9A+buJZYqkAH6Z/g==; 7:Hk8LfAM3y5WNr1KkFe72jL9YUs3ctXC4BQmPlPzyk2YQ/pd2SbjCfnf3GbxzNrW+0MQ1V0VfpZLtXcFYG7VuUQ+I8xH505nXFBaHHyOXArVYxWCZhpsvmdR5XFK8Wrz11F5gLIvpcidifoqsdbGCoA== x-ms-office365-filtering-correlation-id: e0b46cff-9c72-4cdf-7fc3-08d68ce208ab x-ms-office365-filtering-ht: Tenant x-microsoft-antispam: BCL:0; PCL:0; RULEID:(2390118)(7020095)(4652040)(8989299)(4534185)(4627221)(201703031133081)(201702281549075)(8990200)(5600110)(711020)(4605077)(4618075)(2017052603328)(7153060)(7193020); SRVR:AM6PR0402MB3589; x-ms-traffictypediagnostic: AM6PR0402MB3589: x-ld-processed: 686ea1d3-bc2b-4c6f-a92c-d99c5c301635,ExtAddr x-microsoft-antispam-prvs: x-forefront-prvs: 0941B96580 x-forefront-antispam-report: SFV:NSPM; SFS:(10009020)(396003)(136003)(366004)(39860400002)(346002)(376002)(189003)(199004)(106356001)(36756003)(2201001)(81156014)(8936002)(86362001)(4326008)(6116002)(71200400001)(81166006)(256004)(6512007)(71190400001)(66066001)(53936002)(105586002)(8676002)(68736007)(386003)(6506007)(11346002)(97736004)(476003)(3846002)(486006)(446003)(14454004)(7416002)(50226002)(2616005)(478600001)(6486002)(25786009)(4744005)(186003)(26005)(6436002)(99286004)(316002)(110136005)(7736002)(76176011)(305945005)(2501003)(102836004)(52116002)(2906002)(921003)(1121003); DIR:OUT; SFP:1101; SCL:1; SRVR:AM6PR0402MB3589; H:AM6PR0402MB3911.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: wwrJU9DWRWaYFn/73mymSw5Mtp/AFgwqbJTCXAO3rx69vMEErWlfvza9CHRGk8584O8QQv6xJQRuX3FoDlj9zJb43s9/Oxna6Do8iqc07QzC/1CxqHM4OxKmoTz0JO5NIPJd36eFRBYTDEtxuygGmTVvtcImF9P6INdsgrqGRv32B1Yu3AUXr4iWoixpv8DoD5bmkhJinSBy/+KLZyIoTZ1zqNaTm3k2o2Z54RBH/Aw2LPaIvVfcqWbRsGR/f3tdl+5Pcq/4o8vJoGKS00d5v1B+e57uS8i8T2HyO4eZeplupWeTa7red/yOfjFFCmej6e2R/JIV2Ab6lU8rmJeqIc9F3zwRuxT7PmFTKnylKzq6ezUr0LERES6i822bHdH0FI/cglxJvokC/pC1Ed8sDnNK5PVOA20wxGhfuWjLEu8= MIME-Version: 1.0 X-OriginatorOrg: nxp.com X-MS-Exchange-CrossTenant-Network-Message-Id: e0b46cff-9c72-4cdf-7fc3-08d68ce208ab X-MS-Exchange-CrossTenant-originalarrivaltime: 07 Feb 2019 09:52:47.2399 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-mailboxtype: HOSTED X-MS-Exchange-CrossTenant-id: 686ea1d3-bc2b-4c6f-a92c-d99c5c301635 X-MS-Exchange-Transport-CrossTenantHeadersStamped: AM6PR0402MB3589 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20190207_015302_135005_435AC8A8 X-CRM114-Status: GOOD ( 10.70 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: dl-linux-imx Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.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 709e8f1..4c79832 100644 --- a/arch/arm64/configs/defconfig +++ b/arch/arm64/configs/defconfig @@ -413,6 +413,7 @@ CONFIG_SENSORS_INA2XX=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_THERMAL=y CONFIG_RCAR_GEN3_THERMAL=y From patchwork Thu Feb 7 09:53:04 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Anson Huang X-Patchwork-Id: 10800695 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 D0C7313A4 for ; Thu, 7 Feb 2019 10:07:24 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id BA8022D127 for ; Thu, 7 Feb 2019 10:07:24 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id AABF92D161; Thu, 7 Feb 2019 10:07:24 +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=-5.2 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,MAILING_LIST_MULTI,RCVD_IN_DNSWL_MED autolearn=ham version=3.3.1 Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id 387362D127 for ; Thu, 7 Feb 2019 10:07:24 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20170209; h=Sender: Content-Transfer-Encoding:Content-Type:Cc:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:In-Reply-To:References: Message-ID:Date:Subject:To:From:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=E68ahEj+ygz1IC8rPz0+yC3+bADUD6odqJmLi5s9sSc=; b=iWzoXq0+tOcFSf WPppmT9sOS6fsaRI7jn14MK2eDMw1bxNwXh4Uhige6kQdYBXUilAKjb/wexRX4IPoxEeI+6pONIhy SWSSVrfzBZBbHJw68KhBAeC784c4S8aaYJSeLg0Sq6sXfVsHu7Xs+YHZuw0f6wzb/4Z+yhHQL7BN2 VdIWkfduvqxMAHMiNXFjmfMYhSGzoKn/FqbpdMP2uPOMWuS+7jQaj6d9ymtz4D8x0WX12ib2r9SgM LjwH62eOFvUIrTZFZl8eBfGxfoBjL4jj4XVOVIgOBMNw/rXhEQ8dN5WnbudXQwOQISc0Xs+n09/EB tIu+hD3ZeCqFK9QvFypQ==; Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.90_1 #2 (Red Hat Linux)) id 1grgaW-0000SR-A9; Thu, 07 Feb 2019 10:07:20 +0000 Received: from casper.infradead.org ([2001:8b0:10b:1236::1]) by bombadil.infradead.org with esmtps (Exim 4.90_1 #2 (Red Hat Linux)) id 1grgaK-0008OX-27 for linux-arm-kernel@bombadil.infradead.org; Thu, 07 Feb 2019 10:07:08 +0000 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=casper.20170209; h=MIME-Version:Content-Transfer-Encoding: Content-Type:In-Reply-To:References:Message-ID:Date:Subject:CC:To:From:Sender :Reply-To:Content-ID:Content-Description:Resent-Date:Resent-From: Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Id:List-Help: List-Unsubscribe:List-Subscribe:List-Post:List-Owner:List-Archive; bh=akL6azETByb8lpJJz81E9Yxs+TgFx/7v00NFRGnk8R0=; b=iRYKvDTiKQhDTy+VsYQperA6RG +dEwG+RjTzzKJ8bz4h3b32VKskJT6l2MZ1c2IySWBoQVExWNELpxE3x7fQmCvISo1/X27oqOOgsQn 3BjjZHzxb/3gZ8/n/CFwRH2gM5SQZVqApZ6LEXAqaP7yT8XKZM9GkT9zmWwg6dbAGOUoZenjzvErK U8+ybefNdN1AvUBInmr4N568xiOalIp7olLG82hKTx0PJ2v8xQ2dIcSFEbhFgpKX5ZPpO5fDbCsdR b8guf4cxU1WWiXB/P9f3DGgOP0gPR+aT6kH4j8NwLPd5uZGecaH31Vp6JqWGmdpvu+yHG3iZaQzaF HNx4lPBg==; Received: from mail-eopbgr20050.outbound.protection.outlook.com ([40.107.2.50] helo=EUR02-VE1-obe.outbound.protection.outlook.com) by casper.infradead.org with esmtps (Exim 4.90_1 #2 (Red Hat Linux)) id 1grgMn-0007nU-9X for linux-arm-kernel@lists.infradead.org; Thu, 07 Feb 2019 09:53:10 +0000 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=akL6azETByb8lpJJz81E9Yxs+TgFx/7v00NFRGnk8R0=; b=EuQlpGI7xMwqr/uXFXgsHuvnzuxBHH3bRiY5sqW7Z0z4gP04WTQvU1DKl0rzmHqP6ABnaEkev6YeSbbS+RVy/G/0h3VkDFCtybhwZCT330NM6j1qiieJy70+DDuF83EiiA/Y2pMAA9rVTNIP29/erZxBGZJ3CaYTVYC1O8kE3io= Received: from AM6PR0402MB3911.eurprd04.prod.outlook.com (52.133.30.10) by AM6PR0402MB3623.eurprd04.prod.outlook.com (52.133.20.24) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.1580.22; Thu, 7 Feb 2019 09:53:05 +0000 Received: from AM6PR0402MB3911.eurprd04.prod.outlook.com ([fe80::6c94:4ad8:e9f3:cf1]) by AM6PR0402MB3911.eurprd04.prod.outlook.com ([fe80::6c94:4ad8:e9f3:cf1%4]) with mapi id 15.20.1601.016; Thu, 7 Feb 2019 09:53:05 +0000 From: Anson Huang To: "robh+dt@kernel.org" , "mark.rutland@arm.com" , "shawnguo@kernel.org" , "s.hauer@pengutronix.de" , "kernel@pengutronix.de" , "festevam@gmail.com" , "catalin.marinas@arm.com" , "will.deacon@arm.com" , "rui.zhang@intel.com" , "edubezval@gmail.com" , "daniel.lezcano@linaro.org" , Aisheng Dong , "ulf.hansson@linaro.org" , Daniel Baluta , "horms+renesas@verge.net.au" , Andy Gross , "heiko@sntech.de" , "arnd@arndb.de" , "maxime.ripard@bootlin.com" , "jagan@amarulasolutions.com" , "bjorn.andersson@linaro.org" , "enric.balletbo@collabora.com" , "marc.w.gonzalez@free.fr" , "olof@lixom.net" , "devicetree@vger.kernel.org" , "linux-kernel@vger.kernel.org" , "linux-arm-kernel@lists.infradead.org" , "linux-pm@vger.kernel.org" Subject: [PATCH V6 4/4] arm64: dts: imx: add i.MX8QXP thermal support Thread-Topic: [PATCH V6 4/4] arm64: dts: imx: add i.MX8QXP thermal support Thread-Index: AQHUvsrro3gZQGWeX0+f2u2qQHzVZw== Date: Thu, 7 Feb 2019 09:53:04 +0000 Message-ID: <1549532838-27025-4-git-send-email-Anson.Huang@nxp.com> References: <1549532838-27025-1-git-send-email-Anson.Huang@nxp.com> In-Reply-To: <1549532838-27025-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: HK2PR02CA0190.apcprd02.prod.outlook.com (2603:1096:201:21::26) To AM6PR0402MB3911.eurprd04.prod.outlook.com (2603:10a6:209:1c::10) 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; AM6PR0402MB3623; 6:lEaihKE5dmqEN87GsSxlyTNVRTBC3r6OFvEO0yP5AR3jUGghtLQ8StJm9Vtgi4Jej3Phlg8iVmlrwQuUBzHoGnlJvWQ+V81IOHMjjYdYVz6G8SvdZx3fq5MNQ1F82S1e/uavoahifp0EWjJiYLHaXn1nkMIpAv5BnnkCzvVf9mXc08LrjK1qiOA6hDmv3rErvOHaN0i+8Bm7+J2G0KOvxv6K4U5N2rSjvxevx3EgtbGawcXC61418dR06+LJiy2ACyv+v4J3i7wwB25FRW8J8Ty7GuaYV+Ov+6+oCy8uacSOxnpvNL2Gigmz61CAje+FWLDevndUztzwEehs502KCSCFz77YVWuSx/U3CdPgbSQKcxW4ugAEHc4eIJjDFHv2M/+LurToTlP4RLwFk9afWAxmVGLlk2qYnceBNbWrWPYQiixhgwcgy5pbdKVUAVx/luw1KABZHoMZE+oKNeWtJQ==; 5:57ekaKTfQ7DhtSNx07GtfwWzpdH23ftkXwN3c0L13pnMe8KVzkyy3o8fIf0P6+9pMR3SdMa0oBwpYEa8NmSyInGP2Tc/zeZ9EL0VaqTsAt2c/6/u1KsorYJgFW5+lxaV1DtpZxyYOTv79eBeAwsjBY6IrEIja/OMjRnslE9e6Uku0sJaLdgjshEj0d6DzcpGbjNolCA07KFIE8ENy+F3xw==; 7:vKDfX/790mKKHRfirimajZUlvAjEhL37UH+bK5cW4fLL9FQgnsiKI9Tfznlyzm95VlYN6iUVTtKtQArqOB69vf3WsQhSxtQnBFKDNfzjmwHUgnSv7YUY7tQm3Lfpsa4Y1hNxagV+t41EWRTqcbEi/g== x-ms-office365-filtering-correlation-id: d2a3a13f-a2a2-43b3-1b2a-08d68ce20e1a x-ms-office365-filtering-ht: Tenant x-microsoft-antispam: BCL:0; PCL:0; RULEID:(2390118)(7020095)(4652040)(8989299)(4534185)(4627221)(201703031133081)(201702281549075)(8990200)(5600110)(711020)(4605077)(4618075)(2017052603328)(7153060)(7193020); SRVR:AM6PR0402MB3623; x-ms-traffictypediagnostic: AM6PR0402MB3623: x-ld-processed: 686ea1d3-bc2b-4c6f-a92c-d99c5c301635,ExtAddr x-microsoft-antispam-prvs: x-forefront-prvs: 0941B96580 x-forefront-antispam-report: SFV:NSPM; SFS:(10009020)(396003)(376002)(366004)(346002)(39860400002)(136003)(54534003)(199004)(189003)(8676002)(106356001)(50226002)(2906002)(68736007)(7736002)(76176011)(256004)(97736004)(86362001)(36756003)(2616005)(186003)(26005)(110136005)(81166006)(81156014)(476003)(99286004)(486006)(8936002)(11346002)(102836004)(2201001)(71190400001)(52116002)(6506007)(386003)(71200400001)(316002)(6486002)(2501003)(7416002)(6116002)(6436002)(4326008)(66066001)(53936002)(446003)(14454004)(305945005)(6512007)(478600001)(105586002)(3846002)(25786009)(921003)(1121003); DIR:OUT; SFP:1101; SCL:1; SRVR:AM6PR0402MB3623; H:AM6PR0402MB3911.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-ms-exchange-senderadcheck: 1 x-microsoft-antispam-message-info: Iu3uzaHocuv3Y5uK4K3DCIR2vZYaS7w1l6F9fHTUXBCuvYonLszeCxrpQGRWQ3uDeZqJXXLt7a6+g+0ISYuXPlFBTBzsxIuxCfWuRQB5BytBrB95iBwm9vZYeGVFq2PnU4cm9677KMRslS3A7ZcgQnm2o21zRtDfDFMM6JtuiIyu05y6c2jgf13SA6i92bFvEnKIjLNqWJUW5Wd0uSeQ406qrFsyDInF2lj/clES1Ndv6IUwZSuLbQOjUzjK2lG54RzRsBMTflpRsIyqUpDrSInRNiciPoxrF1LM0nSdGZSoAUJJ5OoFmN2QJzjKupghj8j0xfp30GPTaLQvg62GSj4vRTIhvAiyMrJCLk0HSZ0fs1r1Ge8ANhF4buz79gC9Om5BG1h9sPAEqbffCbbyiEUgGuTSRDQOHYRwIgfzMac= MIME-Version: 1.0 X-OriginatorOrg: nxp.com X-MS-Exchange-CrossTenant-Network-Message-Id: d2a3a13f-a2a2-43b3-1b2a-08d68ce20e1a X-MS-Exchange-CrossTenant-originalarrivaltime: 07 Feb 2019 09:52:56.3564 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-mailboxtype: HOSTED X-MS-Exchange-CrossTenant-id: 686ea1d3-bc2b-4c6f-a92c-d99c5c301635 X-MS-Exchange-Transport-CrossTenantHeadersStamped: AM6PR0402MB3623 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20190207_095309_342097_1116CFA1 X-CRM114-Status: GOOD ( 12.61 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: dl-linux-imx Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org X-Virus-Scanned: ClamAV using ClamSMTP Add i.MX8QXP CPU thermal zone support. Signed-off-by: Anson Huang --- ChangeLog since V5: - add a property in each thermal zone to pass resource ID for thermal driver. --- arch/arm64/boot/dts/freescale/imx8qxp.dtsi | 28 ++++++++++++++++++++++++++++ 1 file changed, 28 insertions(+) diff --git a/arch/arm64/boot/dts/freescale/imx8qxp.dtsi b/arch/arm64/boot/dts/freescale/imx8qxp.dtsi index 4c3dd95..88eb04b 100644 --- a/arch/arm64/boot/dts/freescale/imx8qxp.dtsi +++ b/arch/arm64/boot/dts/freescale/imx8qxp.dtsi @@ -10,6 +10,7 @@ #include #include #include +#include / { interrupt-parent = <&gic>; @@ -116,6 +117,12 @@ rtc: rtc { compatible = "fsl,imx8qxp-sc-rtc"; }; + + tsens: thermal-sensor { + compatible = "fsl,imx8qxp-sc-thermal"; + tsens-num = <1>; + #thermal-sensor-cells = <1>; + }; }; timer { @@ -443,4 +450,25 @@ power-domains = <&pd IMX_SC_R_GPIO_7>; }; }; + + thermal_zones: thermal-zones { + cpu-thermal0 { + polling-delay-passive = <250>; + polling-delay = <2000>; + thermal-sensors = <&tsens 0>; + imx,sensor-resource-id = <355>; + trips { + cpu_alert0: trip0 { + temperature = <107000>; + hysteresis = <2000>; + type = "passive"; + }; + cpu_crit0: trip1 { + temperature = <127000>; + hysteresis = <2000>; + type = "critical"; + }; + }; + }; + }; };