From patchwork Tue Feb 13 00:52:48 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Nathan Morrisson X-Patchwork-Id: 200148 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a05:7300:bc8a:b0:106:860b:bbdd with SMTP id dn10csp271626dyb; Mon, 12 Feb 2024 17:37:26 -0800 (PST) X-Forwarded-Encrypted: i=3; AJvYcCXAV+dK35hEcs9n24j+vPojcjT1tPD78cNRo/oEaAOgzoAJvhEkXOn9YObkXF6+6RjrcW5gzg1F69CDzjHGulU3K3dO4g== X-Google-Smtp-Source: AGHT+IFEPs5CrfNqEuVJX61uiGPXWDmEBVLxRnF+YoD45prXDuyHpOxVgvb3fYcDGNlDMPLktdOq X-Received: by 2002:a05:6358:1212:b0:176:9f24:d06b with SMTP id h18-20020a056358121200b001769f24d06bmr10241936rwi.1.1707788245851; Mon, 12 Feb 2024 17:37:25 -0800 (PST) X-Forwarded-Encrypted: i=3; AJvYcCWe198+QTbhRgu71Apb+axQUNyuhRHf+E0I1lTYai7N6zrqcN0PM2EF4ezbRe1mIR5H71UcdYX6hZdsqMjD51A0iDt9bg== Received: from sy.mirrors.kernel.org (sy.mirrors.kernel.org. [2604:1380:40f1:3f00::1]) by mx.google.com with ESMTPS id bm22-20020a656e96000000b005dc491ccdadsi1145115pgb.107.2024.02.12.17.37.25 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 12 Feb 2024 17:37:25 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-62775-ouuuleilei=gmail.com@vger.kernel.org designates 2604:1380:40f1:3f00::1 as permitted sender) client-ip=2604:1380:40f1:3f00::1; Authentication-Results: mx.google.com; dkim=pass header.i=@phytec.com header.s=selector1 header.b=SQJHBn+V; arc=fail (signature failed); spf=pass (google.com: domain of linux-kernel+bounces-62775-ouuuleilei=gmail.com@vger.kernel.org designates 2604:1380:40f1:3f00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-62775-ouuuleilei=gmail.com@vger.kernel.org" Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by sy.mirrors.kernel.org (Postfix) with ESMTPS id EE231B25316 for ; Tue, 13 Feb 2024 01:18:26 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 76C072230F; Tue, 13 Feb 2024 00:53:10 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=phytec.com header.i=@phytec.com header.b="SQJHBn+V" Received: from NAM11-DM6-obe.outbound.protection.outlook.com (mail-dm6nam11on2090.outbound.protection.outlook.com [40.107.223.90]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 52C308BE3; Tue, 13 Feb 2024 00:53:03 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=fail smtp.client-ip=40.107.223.90 ARC-Seal: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1707785586; cv=fail; b=e2bsLWOHJ9Pa/qwf2icAoPbpSTGYT0KAFiL9zpRixWeC/VVO/SPg3tMc44dYFVNNKTUnkj/Li+44Ku4kBXq0d9MmI450Kx72FxYtmJqFUtWsmgCey1ldOVquuuahDa5G0UWFq7lpNdYDitv30/QYDag8DKIWnGiWzhrVsttq28s= ARC-Message-Signature: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1707785586; c=relaxed/simple; bh=GFE8vj4/TIefGU5yuDDBr9Q21hamCF2WCswoWB/cT+c=; h=From:To:Cc:Subject:Date:Message-Id:Content-Type:MIME-Version; b=Hrh8nWxFlhVPA6hBAXz3jr4scmiY+QZ4rWUFLdr6J+h5BLQcobJ54ZFv4F00t5mHc+tq0Ckx4EC92VBhP407PjJdkEJQXSnRDPliAotswCPZbl0vhUme9Aq4hCidbG7z4TIu+zSqqjvs84PvpxR7iUyxXAgTvYsaW2uj9+sT9P4= ARC-Authentication-Results: i=2; smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=phytec.com; spf=pass smtp.mailfrom=phytec.com; dkim=pass (1024-bit key) header.d=phytec.com header.i=@phytec.com header.b=SQJHBn+V; arc=fail smtp.client-ip=40.107.223.90 Authentication-Results: smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=phytec.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=phytec.com ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=Um78Ieeg4IpThnvo1ltGZZviRUBdHvhl8M56zjuC1/UgCXnbGHhuOoS+mvESC188vm4F6w+0fmntFHj3E1fCjQmQUxIiij6LkOtF0xbuGCMg7SmFmkJG3CXnezJfF4JX4bdNS2sjxq4rF9arkBqFT6HPuYXkkbjzjCx5Xc45xp/wrxdIaxTy0r6uRlCeUO+6H3Lqjhesx0Sfz/qr7sRcRQbCDWhahbFf3jzG0qzOhgPYOplvYXs4bNJ1H6NQtcuEjuQx58GWLC/9fDQ70NQBLhHGfctkU4rH5c/m7c2m8pKMqzi+Urq4nEh4hm1P5u0VhvHi8p0m7WM1PIXeLwzYtA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=qOoMI4jBEfOTxj/K6M0amllauXxJhG+uYIbIGmmtrYs=; b=Onoxc6XkBXj5sM7VCwBOJiBg5z8dYralgSi8WxsL5vf2Fi+TeXDJ8isO60ak5gb08tbbE6yG+T3gv4zdj1SWTO9qxT2Tcu4YSXjNGTTwdE+eRladOR3MJmlYrmnNsiFjCEOswryULD4VbBgh7zEK6Xj/P9OlFj9s3Ow97LXQni/k320MnI9ttFvT9BgeyCchiP70lNRq5Q/TaJmN+PSaKGDUSSuf6YIJT4D+rj7dJ6gqrvEapcLTUS39pOsSQkm1Rn0a2Pv2ZJtJh/srSfxw3bVOC9y1KcOK6374YzZ4lqZ6Obx+Ai57Z/IJa5mi7SRzKECP8zEsYMFb2PEYWqiW9w== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=phytec.com; dmarc=pass action=none header.from=phytec.com; dkim=pass header.d=phytec.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=phytec.com; s=selector1; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=qOoMI4jBEfOTxj/K6M0amllauXxJhG+uYIbIGmmtrYs=; b=SQJHBn+VplWnaG0WZFOKaRo+fwN0EY/yu9ryeqnrS3tgr+kCr2Mh3y7dL0fzXuxLOgPn/BhmGczacQwZh7wMqDCc+HV8ecU1Rk+thW4ds1e2gAuTlxWA2Lvx6JTCMfrB1Ipd7JrDMc7Lz390NE81Vlr8lZV92Q4IkAKHhOpia0A= Authentication-Results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=phytec.com; Received: from SA1PR22MB5636.namprd22.prod.outlook.com (2603:10b6:806:3e2::15) by PH7PR22MB5397.namprd22.prod.outlook.com (2603:10b6:510:322::9) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7270.39; Tue, 13 Feb 2024 00:52:59 +0000 Received: from SA1PR22MB5636.namprd22.prod.outlook.com ([fe80::e2ac:f990:32c6:334b]) by SA1PR22MB5636.namprd22.prod.outlook.com ([fe80::e2ac:f990:32c6:334b%6]) with mapi id 15.20.7270.033; Tue, 13 Feb 2024 00:52:59 +0000 From: Nathan Morrisson To: nm@ti.com, vigneshr@ti.com, kristo@kernel.org, robh+dt@kernel.org, krzysztof.kozlowski+dt@linaro.org, conor+dt@kernel.org Cc: devicetree@vger.kernel.org, upstream@lists.phytec.de, linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org, w.egorov@phytec.de Subject: [PATCH v3] arm64: dts: ti: am62-phyboard-lyra: Add overlay to enable a GPIO fan Date: Mon, 12 Feb 2024 16:52:48 -0800 Message-Id: <20240213005248.1027842-1-nmorrisson@phytec.com> X-Mailer: git-send-email 2.25.1 X-ClientProxiedBy: CH2PR18CA0016.namprd18.prod.outlook.com (2603:10b6:610:4f::26) To SA1PR22MB5636.namprd22.prod.outlook.com (2603:10b6:806:3e2::15) Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: SA1PR22MB5636:EE_|PH7PR22MB5397:EE_ X-MS-Office365-Filtering-Correlation-Id: 3d1a2dcf-8d19-448c-6ca5-08dc2c2e1fc8 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: IbI8C/G6y/dtyq8rDoxew8q0DjlI265GfcHdPju1zVnIZHl/axjJ65hIw23N5L3L4fGhWRhyyZMfDbFke22Yw1Z3hke+6vEg+EDLpK64GqpvQapFgzltHjlhVnNIbI7p6FOOK1xZcwgYdeFiuyinK+moznjZtsoQz56ueWGLp14YVSqFh9rSBra/ksGWvm4gcmoHVo6k5w+84GcPQ3YDraRRZqiy4qtm/WvGXEICKTTK4eD7LumKMZ4lV4eXZ7hCqH27/WS6DDddUoyD+HAGHOUFWZ34u98rUykbO6/V3AAaelzDLziFmYWPNDkFGkXoy9UPqftrV34bJfhA0QTFo12LPYO4Dkr1Yv6n5yNP8wJGiok8y6323DGlIBQ8BEs7PMU4o7vZ8uYdML0h/ayDA+Hq44v8WG2XMFlmj2Oklc/xRDiDLJN7/l37ZUw1IHGTT4mecH45zLxNKohAc/UteuLnEyC9SxX5qbILtsT5pnx1zZdLNVTBQln2pb4LQNIpop1+Xj4MB1KIcc9UsvmE4V6LNSV/Nxbi/LMCenV7Aec/iQXimCi8XdvK1jcFvVBAUvSnVQoUyQq2FZYE28Szp0eXVsX2G6D5EdzKFCpj8MRUedtWYPTtFeOxq/lwtlMs X-Forefront-Antispam-Report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:SA1PR22MB5636.namprd22.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230031)(396003)(39840400004)(136003)(366004)(376002)(346002)(230922051799003)(186009)(64100799003)(451199024)(1800799012)(86362001)(36756003)(38100700002)(52116002)(6506007)(6512007)(316002)(478600001)(6486002)(6666004)(26005)(83380400001)(2616005)(41300700001)(1076003)(38350700005)(4326008)(2906002)(7416002)(8936002)(8676002)(66946007)(66476007)(66556008)(5660300002);DIR:OUT;SFP:1102; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: pJ3eEvKFvvEw67YOJ6yvPOl+B6PEkHXltPhxmhjWAEwv4i+p5igWpK55yCeAXIPfbRlRUM7poRoDWG6OiWhOniAxFFph4rIHmMkCN/JSdM5hyKBimOAJ5PlqlyEn7o+jwqW96y0G1qNG/LI/T8lqsFNwlahkYlZ8vFsJVqfn1ATK54k7lll6ZAfJb06ebrAs/+OCvMtK00NOGK/K4GwTetYK0Lli3rzmf9h+givhlfmX0F92/DLEGiSSzDctRiQGIezBKo5swhvgRpL6qbZT+XPSLifZa/fe44JoBB0/xmGGoxj2HLUyAGn4G2pyeWiuv5Yj0wk0Okc/yysFYJGCefB8AUOxpzh1Jh6n3AOwdccutbGjnPq86A6p5gCfuZdDsCuJ3BGxbxEzbJw3WdLxO02mrjoUKivb+aAnL5Jwz5Rnd+6cySxi0LxOtqEMTPYfqE9POSAHCbsPH/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XiCgtOZqRddejThkjd4PB5fvYQi/UhpAYV9LieJNn5UnQerypqSsEsHnTC9Dz X-OriginatorOrg: phytec.com X-MS-Exchange-CrossTenant-Network-Message-Id: 3d1a2dcf-8d19-448c-6ca5-08dc2c2e1fc8 X-MS-Exchange-CrossTenant-AuthSource: SA1PR22MB5636.namprd22.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 13 Feb 2024 00:52:59.4319 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 67bcab1a-5db0-4ee8-86f4-1533d0b4b5c7 X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: M0FEdp7mOJ9K+xx5weKRGwm3ecdWRLxDWVECqlI7UCSdjEkgxFm7adLSJHb0TCz38E+X+oMzfEb/Llq05+nqYw== X-MS-Exchange-Transport-CrossTenantHeadersStamped: PH7PR22MB5397 X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1790745767483493202 X-GMAIL-MSGID: 1790745767483493202 The phyBOARD-Lyra has a GPIO fan header. This overlay enables the fan header and sets the fan to turn on at 65C. Signed-off-by: Nathan Morrisson Reviewed-by: Wadim Egorov --- v3: - Remove fan status okay v2: - Change overlay name from k3-am62-... to k3-am62x-... - Add compile time test arch/arm64/boot/dts/ti/Makefile | 3 ++ .../ti/k3-am62x-phyboard-lyra-gpio-fan.dtso | 50 +++++++++++++++++++ 2 files changed, 53 insertions(+) create mode 100644 arch/arm64/boot/dts/ti/k3-am62x-phyboard-lyra-gpio-fan.dtso diff --git a/arch/arm64/boot/dts/ti/Makefile b/arch/arm64/boot/dts/ti/Makefile index 52c1dc910308..bfeb496d5039 100644 --- a/arch/arm64/boot/dts/ti/Makefile +++ b/arch/arm64/boot/dts/ti/Makefile @@ -22,6 +22,7 @@ dtb-$(CONFIG_ARCH_K3) += k3-am625-verdin-wifi-dahlia.dtb dtb-$(CONFIG_ARCH_K3) += k3-am625-verdin-wifi-dev.dtb dtb-$(CONFIG_ARCH_K3) += k3-am625-verdin-wifi-mallow.dtb dtb-$(CONFIG_ARCH_K3) += k3-am625-verdin-wifi-yavia.dtb +dtb-$(CONFIG_ARCH_K3) += k3-am62x-phyboard-lyra-gpio-fan.dtbo dtb-$(CONFIG_ARCH_K3) += k3-am62-lp-sk.dtb # Boards with AM62Ax SoC @@ -87,6 +88,8 @@ k3-am625-beagleplay-csi2-ov5640-dtbs := k3-am625-beagleplay.dtb \ k3-am625-beagleplay-csi2-ov5640.dtbo k3-am625-beagleplay-csi2-tevi-ov5640-dtbs := k3-am625-beagleplay.dtb \ k3-am625-beagleplay-csi2-tevi-ov5640.dtbo +k3-am625-phyboard-lyra-gpio-fan-dtbs := k3-am625-phyboard-lyra-rdk.dtb \ + k3-am62x-phyboard-lyra-gpio-fan.dtbo k3-am625-sk-csi2-imx219-dtbs := k3-am625-sk.dtb \ k3-am62x-sk-csi2-imx219.dtbo k3-am625-sk-csi2-ov5640-dtbs := k3-am625-sk.dtb \ diff --git a/arch/arm64/boot/dts/ti/k3-am62x-phyboard-lyra-gpio-fan.dtso b/arch/arm64/boot/dts/ti/k3-am62x-phyboard-lyra-gpio-fan.dtso new file mode 100644 index 000000000000..f0b2fd4165a7 --- /dev/null +++ b/arch/arm64/boot/dts/ti/k3-am62x-phyboard-lyra-gpio-fan.dtso @@ -0,0 +1,50 @@ +// SPDX-License-Identifier: GPL-2.0-only OR MIT +/* + * Copyright (C) 2024 PHYTEC America LLC + * Author: Garrett Giordano + */ + +/dts-v1/; +/plugin/; + +#include +#include +#include "k3-pinctrl.h" + +&{/} { + fan: gpio-fan { + compatible = "gpio-fan"; + gpio-fan,speed-map = <0 0 8600 1>; + gpios = <&main_gpio0 40 GPIO_ACTIVE_LOW>; + #cooling-cells = <2>; + pinctrl-names = "default"; + pinctrl-0 = <&gpio_fan_pins_default>; + }; +}; + +&main_pmx0 { + gpio_fan_pins_default: gpio-fan-default-pins { + pinctrl-single,pins = < + AM62X_IOPAD(0x0a4, PIN_OUTPUT, 7) /* (M22) GPMC0_DIR.GPIO0_40 */ + >; + }; +}; + +&thermal_zones { + main0_thermal: main0-thermal { + trips { + main0_thermal_trip0: main0-thermal-trip { + temperature = <65000>; /* millicelsius */ + hysteresis = <2000>; /* millicelsius */ + type = "active"; + }; + }; + + cooling-maps { + map0 { + trip = <&main0_thermal_trip0>; + cooling-device = <&fan THERMAL_NO_LIMIT THERMAL_NO_LIMIT>; + }; + }; + }; +};