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: 1644687 Return-Path: X-Original-To: incoming-dt@patchwork.ozlabs.org Delivered-To: patchwork-incoming-dt@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=vger.kernel.org (client-ip=2620:137:e000::1:20; helo=out1.vger.email; envelope-from=devicetree-owner@vger.kernel.org; receiver=) Received: from out1.vger.email (out1.vger.email [IPv6:2620:137:e000::1:20]) by bilbo.ozlabs.org (Postfix) with ESMTP id 4LPVXL3hf5z9sGD for ; Fri, 17 Jun 2022 17:09:22 +1000 (AEST) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1380486AbiFQHJT convert rfc822-to-8bit (ORCPT ); Fri, 17 Jun 2022 03:09:19 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:46908 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1380446AbiFQHJF (ORCPT ); Fri, 17 Jun 2022 03:09:05 -0400 Received: from de-smtp-delivery-113.mimecast.com (de-smtp-delivery-113.mimecast.com [194.104.109.113]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id 255D8E017 for ; Fri, 17 Jun 2022 00:08:55 -0700 (PDT) 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: zzNA7pMKn00R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lAmCLFSGML6RhrZQkoxvVUhQLuZSN2QzJB4pq+MOY5BH/K6m99FO5EWx47xOohr74Yc4EpX/50jYcKhzG2/IS5RWcha9YO9a/CSgoJJSfN5ICop7O+6oSabSQE1RihPOnLUdZrCPx77GGMsW+tYsQvyZPSC7W3v16Zp+SQMLQ71rvSpQSKTKInP8OE0CGcfLkdqU5HOjAwJjjWJ99lpSj6OrFM7nU2LM5q2KLQ2dekCpMFoxeFZC5SuHLYyUIJfAJc2CnX1Ex/sat6wk+TAQfdFntHE/UcUy7ErGm9/pIQVPGUz7nLfySOem4JRjAsEEUPIVaeZBN1LEOc20FOOyfWaor9P5TW8pj/IAPkANESX2hk2pz86xxbzGXPgFkZiX0e2Xr6VUC46DgyIINij02KvEky855dgyEn5Ju4KhnO49BrtNRuR15y1cOh4zCPMXgnmZ9Mpy4x/wx4cAkrxWq5ZL6Erp+fllcbYxEei0wCHsXExfegzvGQd+ObM+vLsU40372cAq+s9TUDPUgpSLhu+day6NPBmmwvNcj8ZRiQlbSkDrvp6LapFaFfjLE5DWgDc9rozfD92r5ReU05kzhv7hhGy4okS85dMRjZuQOaOAtMH0YiIIRT67CclmbgZ/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-Spam-Status: No, score=-2.6 required=5.0 tests=BAYES_00,RCVD_IN_DNSWL_LOW, SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: devicetree@vger.kernel.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