From patchwork Fri Jun 17 07:08:38 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Francesco Dolcini X-Patchwork-Id: 12885132 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 69629C43334 for ; Fri, 17 Jun 2022 07:10:20 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:Message-ID:Date:Subject:CC :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=vWsgL7OqA8LfRM0gAyXrmb5KR9KcqFcmDPGUXyCP7do=; b=EHmCLbvWv893dD gb2ZKotvN566FYjfJKkvCGySLCtAh+Asho7rrhhzaLzQJjuXeOOjzlxjc4nZLFnh/wGceIfdY34rh 6MKmtZClBYerYy6wJPcsTczgwVk5UuntPoSmQa+AcFGEXq0FbffzDFPz2p1Ab2mEPpAESPLvk3L1D 2XQMbHEWCJdvkdF0MY3eYPnTfb/AIzrD+bHBXatr3iK6AF5gL+nlIXerzUyPTtyu2hk1aBXUxZlRC 7VAs3FRfx3cx2I4E/VVMOKh51KqCjvuqWOA7gOfGYuEfYWZPlj/n12NRPpUuorzJruiv7drvFO/I7 32yCdPgcTchYLCTD1Aog==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1o266S-005qez-SO; Fri, 17 Jun 2022 07:09:13 +0000 Received: from de-smtp-delivery-113.mimecast.com ([194.104.109.113]) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1o266F-005qYd-Ad for linux-arm-kernel@lists.infradead.org; Fri, 17 Jun 2022 07:09:01 +0000 Received: from CHE01-GV0-obe.outbound.protection.outlook.com (mail-gv0che01lp2048.outbound.protection.outlook.com [104.47.22.48]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id de-mta-15-NY3MGSrGP1ONl_VP-0OvSA-2; Fri, 17 Jun 2022 09:08:52 +0200 X-MC-Unique: NY3MGSrGP1ONl_VP-0OvSA-2 Received: from ZRAP278MB0495.CHEP278.PROD.OUTLOOK.COM (2603:10a6:910:2e::8) by GVAP278MB0263.CHEP278.PROD.OUTLOOK.COM (2603:10a6:710:3d::7) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5353.15; Fri, 17 Jun 2022 07:08:50 +0000 Received: from ZRAP278MB0495.CHEP278.PROD.OUTLOOK.COM ([fe80::2879:acb:62c8:4987]) by ZRAP278MB0495.CHEP278.PROD.OUTLOOK.COM ([fe80::2879:acb:62c8:4987%8]) with mapi id 15.20.5353.016; Fri, 17 Jun 2022 07:08:50 +0000 From: Francesco Dolcini To: Daniel Lezcano , Rob Herring , "Rafael J. Wysocki" , Krzysztof Kozlowski , Shawn Guo , Marco Felsch , Anson Huang CC: Francesco Dolcini , Amit Kucheria , Zhang Rui , linux-pm@vger.kernel.org, devicetree@vger.kernel.org, Pengutronix Kernel Team , Sascha Hauer , Fabio Estevam , NXP Linux Team , linux-arm-kernel@lists.infradead.org Subject: [PATCH v1 0/9] imx: thermal: Allow trip point configuration from DT Date: Fri, 17 Jun 2022 09:08:38 +0200 Message-ID: <20220617070847.186876-1-francesco.dolcini@toradex.com> X-Mailer: git-send-email 2.25.1 X-ClientProxiedBy: MR2P264CA0122.FRAP264.PROD.OUTLOOK.COM (2603:10a6:500:30::14) To ZRAP278MB0495.CHEP278.PROD.OUTLOOK.COM (2603:10a6:910:2e::8) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: c0fb45d4-afcb-4987-e4c7-08da50303abe X-MS-TrafficTypeDiagnostic: GVAP278MB0263:EE_ X-Microsoft-Antispam-PRVS: X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0 X-Microsoft-Antispam-Message-Info: d/SSTfJnwNpzFyM4hLL/ZHsyBytMHKUlSlwVS80NdAQ9VWn2UyD8BclcZpL9gZFLEk58o9CUQxdierBU5+iCH74f3khGq6kr6psabqNeuvPjNVCFnczxANCRFWgV7AVO0rhWgndvT0kvfhV9kh+6EOZBkJsDWvrrQ8SAZmtMDX9gZk6N1GqSjxPPadrfillQIS2GC3rbZSMlv30JDqwDSJQl3+HfHrFJrbsq/wPwdOuZ+2OE+8pSWCqPyzJdMsy5JkeleGxKSX305mqN2wFvHoyJ6zpZyD/w4U+odrAgSHICuNp/ec7Lz+q10obyNrDyLPTlavJY5DJ76TwfR334Ko+9zfP3U0oQ5JVxJemQlDE4nYikno/WTdPxLLKEPNtj/UnlkhoV48tZSkdlxOv5VK4f3lkHnsL7QGxYCwnXMYlDeqwpI7phodJ+y9CgsvwCEmMb7k7Eo+w5zDjeKyhkUzb/1wDaercSOGIlwq3f284ty2uFL2eEuVg6Hm6y7Fz58o6IBc6w+d6DodW6DzlUoOJVJAH83dbWDFVV7M42hiImPULsg9RdRXfyp9FgSZ4F/dUGGG/bwgVNPnQyVFHlw5h/r2do3MsuJBUcTvq5vDqy66w6t1YZRwwUhZ9D2fS3b4ljfGB8OHX0vR1IKOdiwQ/f22ZqTUhGUPYHoqqHhf/QGMdVosVSz139wkVstCALvPUT1J6cTp86JG0nYO+6grqCuvCdMYsz13l6FFnUR2UdgFvZN1UxdNCcNDoQ6IoWXsROtIPIqOUXHyYKxsZVxY9D5Z3x9MiH0OeTeZ2DCFU= X-Forefront-Antispam-Report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:ZRAP278MB0495.CHEP278.PROD.OUTLOOK.COM;PTR:;CAT:NONE;SFS:(13230016)(4636009)(39840400004)(346002)(136003)(396003)(366004)(38100700002)(966005)(6506007)(52116002)(8936002)(6666004)(6512007)(6486002)(26005)(83380400001)(2906002)(110136005)(5660300002)(54906003)(316002)(36756003)(86362001)(1076003)(2616005)(41300700001)(66556008)(4326008)(44832011)(8676002)(186003)(66476007)(38350700002)(508600001)(66946007)(7416002);DIR:OUT;SFP:1102 X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: zzNA7pMKn00RzNSRd0PnXjDV9EL/AIuPoGfumLga+dyq+AiOA/mpRJMWAB2Lw3yW9os3zfr61reSePwNNy+BiZDIPn4j5IQjN/PuvUbrlk18eW5N+uedwuqaZbceob1jxqMjP1EH59h0vMhh98nYjM845f/TgVEal2JBFND1lKsoq9umZjN/KxUw05LXmpijJClvgLx0BBuMFoU3xg/aCaE27gOJB+JL3mLEbEVHu/6SIh2QXijr5vmbgFGv7lpRspRqhfV6jHl+ctez3MCOIWzmB+ra600cIKw6hXQbuOKmiXqkQLykSEDSl0YTAA5+sfwXTGSWTa6+tifmIQf0Hc4FMls7LymCcleBxBFr6eylJNqSi8cWiPWENWjowunQgfW71In/HJT6uZ7RSmvuy3MMQgpIwXByA5qYt8xrgAv7ARpfOmMt9IZWels5CvvYR2nMeMyY7HPh6rbTotrVTotSo4e2WUzk/pEfukrFbRJ5ah2icYBzRM+41TDN/hJIvuHqsWnJRBc5P3gCOhP4cKkcrqdvdqaXXhXk93vN7IgnRLN21Ut+5u3CX70Kl9Iaiv+S3yubE4dADm+EOy6DbexUPbCH5IEQXR/lWx7L+EfeBuyLiU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S85dMRjZuQOaOAtMH0YiIIRT67CclmbgZ/bGuaVDbFqSrlBh9pATRZ79tVz/E= X-OriginatorOrg: toradex.com X-MS-Exchange-CrossTenant-Network-Message-Id: c0fb45d4-afcb-4987-e4c7-08da50303abe X-MS-Exchange-CrossTenant-AuthSource: ZRAP278MB0495.CHEP278.PROD.OUTLOOK.COM X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 17 Jun 2022 07:08:50.1993 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: d9995866-0d9b-4251-8315-093f062abab4 X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: GtdTKgY4N3Dd6Ine4X0ngFgokZWRNz6C0PVe92O8u1c41UeMpZi0g2YHzEmgNUDMMI9hFHADQOfopgTFwZPzEr7CA+kUyujDooFCfubpF+w= X-MS-Exchange-Transport-CrossTenantHeadersStamped: GVAP278MB0263 Authentication-Results: relay.mimecast.com; auth=pass smtp.auth=CDE13A77 smtp.mailfrom=francesco.dolcini@toradex.com X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: toradex.com X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20220617_000859_724726_6D203532 X-CRM114-Status: GOOD ( 13.58 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org This series allows to specify the imx thermal drivers trip point from the device tree, without this change the threshold are hard-coded and this might not be correct given the thermal design of the final system. This change is backward compatible with the existing device tree, and even with this change in by default the thresholds are the same as before. Toradex board are also updated to use a system-specific thresholds. Discussion on the current design is here: https://lore.kernel.org/all/4ba1d7d2-3e8c-ba60-37fd-9598f415c076@linaro.org/ One side note, after this change the dtbs checker starts complaining with this message ``` linux/arch/arm/boot/dts/imx6dl-alti6p.dtb: tempmon: '#thermal-sensor-cells' does not match any of the regexes: '^(automotive|commercial|extended-commercial|industrial)-thermal$', 'pinctrl-[0-9]+' From schema: linux/Documentation/devicetree/bindings/thermal/imx-thermal.yaml ``` to my understanding this is just a side effect, '#thermal-sensor-cells' is not changed in any way by this series. I can fix that, I wonder if I should remove the property from the imx dtsi files or add it to the binding yaml definition, not sure about it. Anybody can advise? Changes in v2: - fix build error without CONFIG_THERMAL_OF - more verbose error reporting in case the dts is not correct - additional comment on the threshold fixup in case the passive threshold is higher than critical - while parsing the dts thermal, return immediately if the node is not there Francesco Dolcini (9): dt-bindings: thermal: Define trips node in $defs thermal: thermal: Export OF trip helper function dt-bindings: thermal: imx: Add trips point imx: thermal: Configure trip point from DT ARM: dts: imx[67]: Add trips points ARM: dts: imx6qdl-apalis: Set CPU critical trip point ARM: dts: imx7-colibri: Set CPU critical trip point ARM: dts: imx6ull-colibri: Set CPU critical trip point ARM: dts: imx6qdl-colibri: Set CPU critical trip point .../bindings/thermal/imx-thermal.yaml | 27 ++++ .../bindings/thermal/thermal-zones.yaml | 130 +++++++++--------- arch/arm/boot/dts/imx-thermal.dtsi | 61 ++++++++ arch/arm/boot/dts/imx6qdl-apalis.dtsi | 12 ++ arch/arm/boot/dts/imx6qdl-colibri.dtsi | 12 ++ arch/arm/boot/dts/imx6qdl.dtsi | 2 + arch/arm/boot/dts/imx6sl.dtsi | 2 + arch/arm/boot/dts/imx6sll.dtsi | 2 + arch/arm/boot/dts/imx6sx.dtsi | 2 + arch/arm/boot/dts/imx6ul.dtsi | 2 + arch/arm/boot/dts/imx6ull-colibri.dtsi | 12 ++ arch/arm/boot/dts/imx7-colibri.dtsi | 12 ++ arch/arm/boot/dts/imx7s.dtsi | 2 + drivers/thermal/imx_thermal.c | 58 ++++++++ drivers/thermal/thermal_core.h | 7 + drivers/thermal/thermal_of.c | 5 +- 16 files changed, 283 insertions(+), 65 deletions(-) create mode 100644 arch/arm/boot/dts/imx-thermal.dtsi