From patchwork Tue Oct 11 23:17:17 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Bryan Brattlof X-Patchwork-Id: 13004514 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 C60F7C4332F for ; Tue, 11 Oct 2022 23:19:50 +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:References:In-Reply-To: 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: List-Owner; bh=1VF6gqqTL2fXnItP/VT3acVMJ56mNS13ez7LUkFa47c=; b=Jw84grz62NxPDe Nd5ywY/NonSBUWFiV7ixvTpj1pKGMeIfNAICKJfG3daNIJipCy2fBaXW2f5xsjGvYv04Y8XisUNRy CcrXAMgHcEuiA6xyEfnm4wtfpwXoDcQAlToKNqBPspT580yLxBaGd9AH8x2fwxRmKk77sdjZ2TNUl luMIaDrq0U8PA6eJrNhTXuRGaxN6ceU7n+dnQ0buClIKJNG/+tIjGvVOtWLc9MI30Z1yzkPTCo13M ifgc2mre3l+Hj+MKaPAX2cMJ/2xow9L+hKAzKpbHkQl6Q+cw75DPbRZ2v5ya/D8n4wuCyFvHsiAUr cYCSm7YSvX56y+FeYGWQ==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1oiOWS-0069Af-7v; Tue, 11 Oct 2022 23:18:52 +0000 Received: from lelv0143.ext.ti.com ([198.47.23.248]) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1oiOVo-0068x2-3a for linux-arm-kernel@lists.infradead.org; Tue, 11 Oct 2022 23:18:15 +0000 Received: from lelv0266.itg.ti.com ([10.180.67.225]) by lelv0143.ext.ti.com (8.15.2/8.15.2) with ESMTP id 29BNHvla086163; Tue, 11 Oct 2022 18:17:57 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ti.com; s=ti-com-17Q1; t=1665530277; bh=eC0aHb+aZRyM8fNayBdzRLZlJy26hLJ0809gZrd7XoE=; h=From:To:CC:Subject:Date:In-Reply-To:References; b=Tga55FyEs9VNJ0OeIbXZRDN32ZU/3DPDndInmFPTynPbOi+9KLr3/T2kAsfRpHa2B QCxIKGY1zvkmXXeWVd+JH3e9eU7j7QrYsrUovjjb3bizCfJd5L0lGDhgH4EyRjsVfR 8fiKBDTW/AGHoo47wh5CH3Jl8pThT5UvPhPSMQOA= Received: from DFLE100.ent.ti.com (dfle100.ent.ti.com [10.64.6.21]) by lelv0266.itg.ti.com (8.15.2/8.15.2) with ESMTPS id 29BNHv9k081663 (version=TLSv1.2 cipher=AES256-GCM-SHA384 bits=256 verify=FAIL); Tue, 11 Oct 2022 18:17:57 -0500 Received: from DFLE111.ent.ti.com (10.64.6.32) by DFLE100.ent.ti.com (10.64.6.21) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256_P256) id 15.1.2507.6; Tue, 11 Oct 2022 18:17:57 -0500 Received: from lelv0326.itg.ti.com (10.180.67.84) by DFLE111.ent.ti.com (10.64.6.32) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256_P256) id 15.1.2507.6 via Frontend Transport; Tue, 11 Oct 2022 18:17:57 -0500 Received: from localhost (ileaxei01-snat.itg.ti.com [10.180.69.5]) by lelv0326.itg.ti.com (8.15.2/8.15.2) with ESMTP id 29BNHvhe021888; Tue, 11 Oct 2022 18:17:57 -0500 From: Bryan Brattlof To: Rob Herring , Krzysztof Kozlowski CC: "Rafael J. Wysocki" , Daniel Lezcano , Amit Kucheria , Zhang Rui , Nishanth Menon , Vignesh Raghavendra , Tero Kristo , Keerthy , Linux Thermal , Linux Device Tree , LKML , Linux ARM , Bryan Brattlof Subject: [PATCH 01/11] thermal: k3_j72xx_bandgap: simplify k3_thermal_get_temp() function Date: Tue, 11 Oct 2022 18:17:17 -0500 Message-ID: <20221011231727.8090-2-bb@ti.com> X-Mailer: git-send-email 2.38.0 In-Reply-To: <20221011231727.8090-1-bb@ti.com> References: <20221011231727.8090-1-bb@ti.com> MIME-Version: 1.0 X-Developer-Signature: v=1; a=openpgp-sha256; l=1018; h=from:subject; bh=nybN46Oj7CyEzxnatV6GbN3i3ebMEiKJTdwL6AscGrY=; b=owNCWmg5MUFZJlNZeGrtwAAAa3///v///v966P7SZPTrfu463e3u6v/8/1uLSp29jv90q/8wARsY IeoGR6mQNNAAAGjQNDTQBoAAAPUAyNAAABoGgB6gD1AAPFMZTahsj1Q6DQNABoBpppoaaDQGmg9JmU DagNGQAPUGj1Mg0DI9RtT1NAaaAMgAeo9QaG1AAgNpGmmQ9IMmgNAGQYmQ0DQaMmg0BkxNDJhMmEYJ oxAaBoDQyaBoaABoZNAABEHNh+8SGTgqAwLmSBk6qeoo2t4uFs3NSB+YlIgDpic3oTn/tFx1JPsNUp fI3ERToBz7AEHJoTtalhvW3YrL495OHwLDr00OIXFAhdP8Kr5Fr/Og3WB479+O3vAHEd2Kg1nbVlCf haY8QcNtmlqNmQAxgWJu2DdicGkQASShe9F9tCayEZ1RvHz2rCz204bsqoR2RKsoR7Hc73zjXLkN54 HhKt2WxbUlkQhMcZEwdfpnqC4TMrXfZYOJOgvwdamnMQyVuJ9vLLdRRpHyPI1mCPoL/n1HK81MWipv 0VKzIcDlIRnZ3ZLFluBm2RN26bJismtTpLpnzn2iBtXP88wJD3XxgVXCopQsDmkCNrGRQTdAtUCoxc NNKmoQjy9rMe0GOPksT2AACVfagGsFpqYiXO0RE5AXXNtggGiMGaBX/i7kinChIPDV24A= X-Developer-Key: i=bb@ti.com; a=openpgp; fpr=D3D177E40A38DF4D1853FEEF41B90D5D71D56CE0 X-EXCLAIMER-MD-CONFIG: e1e8a2fd-e40a-4ac6-ac9b-f7e9cc9ee180 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20221011_161812_387800_1A3B2948 X-CRM114-Status: GOOD ( 11.65 ) 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 The k3_thermal_get_temp() function can be simplified to return only the result of k3_bgp_read_temp() without needing the 'ret' variable Signed-off-by: Bryan Brattlof --- drivers/thermal/k3_j72xx_bandgap.c | 9 +-------- 1 file changed, 1 insertion(+), 8 deletions(-) diff --git a/drivers/thermal/k3_j72xx_bandgap.c b/drivers/thermal/k3_j72xx_bandgap.c index c073b1023bbe7..a9f99a190cb61 100644 --- a/drivers/thermal/k3_j72xx_bandgap.c +++ b/drivers/thermal/k3_j72xx_bandgap.c @@ -249,14 +249,7 @@ static inline int k3_bgp_read_temp(struct k3_thermal_data *devdata, /* Get temperature callback function for thermal zone */ static int k3_thermal_get_temp(struct thermal_zone_device *tz, int *temp) { - struct k3_thermal_data *data = tz->devdata; - int ret = 0; - - ret = k3_bgp_read_temp(data, temp); - if (ret) - return ret; - - return ret; + return k3_bgp_read_temp(tz->devdata, temp); } static const struct thermal_zone_device_ops k3_of_thermal_ops = { From patchwork Tue Oct 11 23:17:18 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Bryan Brattlof X-Patchwork-Id: 13004513 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 64F1CC433FE for ; Tue, 11 Oct 2022 23:19:43 +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:References:In-Reply-To: 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: List-Owner; bh=N+ZSfQavdxt/ZFEQBd5D17BUv1hygIolAGkczEVdbFE=; b=3h+jqhGEW81KVm sHY2Bww3HY1aDiEQkZkETwosQfZ+s76INOXQT/ma5SClTqiR8vCeNCFYI+Z56ryQBjz0tagxW31v1 hq3jxT9sgTZQUKW21F8fNmrrISW76sNUSdgcWTWk4DP4BSkmNRgRY2cxSPWzennmaQWXx2/nl66+x PSkUL8T2vtt4ArotUSLjKxWcSZVvUqovkMrctY7ZJ/CtmBjUKgeNWAltmBsZJ12cHEHcUSmDqKPq6 97vQ0tUYIKtQSn074zWdW/ZR8KAPJd++sikxnFumenOmG4ORiCpKHG8lFf8di1vIrABWZsrl1Clt0 q3ezQWJWrFFFI+kl9JEQ==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1oiOWJ-00697d-7Z; Tue, 11 Oct 2022 23:18:43 +0000 Received: from lelv0143.ext.ti.com ([198.47.23.248]) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1oiOVo-0068wn-3Z for linux-arm-kernel@lists.infradead.org; Tue, 11 Oct 2022 23:18:14 +0000 Received: from lelv0265.itg.ti.com ([10.180.67.224]) by lelv0143.ext.ti.com (8.15.2/8.15.2) with ESMTP id 29BNHxbH086168; Tue, 11 Oct 2022 18:17:59 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ti.com; s=ti-com-17Q1; t=1665530279; bh=oPlOVAsMdXzy8y19AijK6Kt1rJmvxBuq0bQNBBMio5g=; h=From:To:CC:Subject:Date:In-Reply-To:References; b=JNtsx2BfVvcI7M8/YBNJLPLBOtCW/OlMs95juLOko2oDi2Dce00r9XDhULNWfzEbk hWHbMeZbhB5oH0QyntYAzLHFYr3Ge/ziH3et46ouZhxRbcTtQ3zvl3QFAi/aKRu4Uv yyXAdZFEc5VjN9oJPB4nemQp9Mjc5offLizF89jc= Received: from DFLE102.ent.ti.com (dfle102.ent.ti.com [10.64.6.23]) by lelv0265.itg.ti.com (8.15.2/8.15.2) with ESMTPS id 29BNHwu5029438 (version=TLSv1.2 cipher=AES256-GCM-SHA384 bits=256 verify=FAIL); Tue, 11 Oct 2022 18:17:58 -0500 Received: from DFLE104.ent.ti.com (10.64.6.25) by DFLE102.ent.ti.com (10.64.6.23) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256_P256) id 15.1.2507.6; Tue, 11 Oct 2022 18:17:58 -0500 Received: from lelv0327.itg.ti.com (10.180.67.183) by DFLE104.ent.ti.com (10.64.6.25) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256_P256) id 15.1.2507.6 via Frontend Transport; Tue, 11 Oct 2022 18:17:58 -0500 Received: from localhost (ileaxei01-snat2.itg.ti.com [10.180.69.6]) by lelv0327.itg.ti.com (8.15.2/8.15.2) with ESMTP id 29BNHwxN058954; Tue, 11 Oct 2022 18:17:58 -0500 From: Bryan Brattlof To: Rob Herring , Krzysztof Kozlowski CC: "Rafael J. Wysocki" , Daniel Lezcano , Amit Kucheria , Zhang Rui , Nishanth Menon , Vignesh Raghavendra , Tero Kristo , Keerthy , Linux Thermal , Linux Device Tree , LKML , Linux ARM , Bryan Brattlof Subject: [PATCH 02/11] thermal: k3_j72xx_bandgap: use bool for i2128 erratum flag Date: Tue, 11 Oct 2022 18:17:18 -0500 Message-ID: <20221011231727.8090-3-bb@ti.com> X-Mailer: git-send-email 2.38.0 In-Reply-To: <20221011231727.8090-1-bb@ti.com> References: <20221011231727.8090-1-bb@ti.com> MIME-Version: 1.0 X-Developer-Signature: v=1; a=openpgp-sha256; l=1775; h=from:subject; bh=G++pLIL58zYxITYxZt/Js9a9L5y9Z83+mB8bqnuk0QA=; b=owNCWmg5MUFZJlNZc5J6KwAAaX////7vb/+7avme6zsd/nu7/8f/77/8u8bv2pntp/3m7/8wARsw HaTQaAABoAAaA0B6Rk0AAaAaAAABoNNGQA00ADEaDRptJoaaMI0aMnkT1CDRkaBoaDQyaNANGgaYJo NqGgGgAAGQaYhhGQA0aGQNGEGh6gGE0ABoAZCGho0GjQNNNNMgaNBo0BpkYjTQAGgGQMQNAGgMRgjE MgaAADJoANGmjAmmgBA3tsDH1kA+YS4MChQkNMixc48PamP0EQcH3h4R2dDz/YAQVaUENTyAQmq8wF ad8slCVbZEYU3Iu7xYLX0A5wexyloD4T877UUi2M24597+Sw4+8VipicodE4TYYnKVagXAMzImjuxT 2y6fX/C011ECzla3KscgUFGihCA2RkCM81BYHuYjLyoPekVmjWPI1629RHrE41+hs+kYlmqT5hz/Nz T8PLH1RBOhVWqQMx+jD0tWGOoqO6PQyFyrts22J8NpzwY1aTmL5QRWDQiCEoy3Af3xRdqUpDSlCpYX abMTH0B53AEBY35cS37+MiEEWUviNocE8xYnBrmL2gZqfIT4Xk1bjVnWC5YvzgxeQMBmiOiLQPv7Ea bqheyR6jJuDsgAyQ87cCsEueXpGZqK1zLypJEuEvTNBYkqC9OgEmMQgi439/WkR/i7kinChIOck9FY X-Developer-Key: i=bb@ti.com; a=openpgp; fpr=D3D177E40A38DF4D1853FEEF41B90D5D71D56CE0 X-EXCLAIMER-MD-CONFIG: e1e8a2fd-e40a-4ac6-ac9b-f7e9cc9ee180 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20221011_161812_305948_ED5A1483 X-CRM114-Status: GOOD ( 15.49 ) 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 Some of TI's J721E's require a software trimming method to report temperatures accurately. Currently we are using a few different data types to indicate when this device should apply the erratum. Change the 'workaround_needed' variable's data type to a bool to align with how we are using this variable currently. Signed-off-by: Bryan Brattlof --- drivers/thermal/k3_j72xx_bandgap.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/drivers/thermal/k3_j72xx_bandgap.c b/drivers/thermal/k3_j72xx_bandgap.c index a9f99a190cb61..b9d20026771a5 100644 --- a/drivers/thermal/k3_j72xx_bandgap.c +++ b/drivers/thermal/k3_j72xx_bandgap.c @@ -340,7 +340,7 @@ static void print_look_up_table(struct device *dev, int *ref_table) } struct k3_j72xx_bandgap_data { - unsigned int has_errata_i2128; + const bool has_errata_i2128; }; static int k3_j72xx_bandgap_probe(struct platform_device *pdev) @@ -351,7 +351,7 @@ static int k3_j72xx_bandgap_probe(struct platform_device *pdev) struct device *dev = &pdev->dev; struct k3_j72xx_bandgap *bgp; struct k3_thermal_data *data; - int workaround_needed = 0; + bool workaround_needed = false; const struct k3_j72xx_bandgap_data *driver_data; struct thermal_zone_device *ti_thermal; int *ref_table; @@ -522,11 +522,11 @@ static int k3_j72xx_bandgap_remove(struct platform_device *pdev) } static const struct k3_j72xx_bandgap_data k3_j72xx_bandgap_j721e_data = { - .has_errata_i2128 = 1, + .has_errata_i2128 = true, }; static const struct k3_j72xx_bandgap_data k3_j72xx_bandgap_j7200_data = { - .has_errata_i2128 = 0, + .has_errata_i2128 = false, }; static const struct of_device_id of_k3_j72xx_bandgap_match[] = { From patchwork Tue Oct 11 23:17:19 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Bryan Brattlof X-Patchwork-Id: 13004535 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 0E4CBC4332F for ; Tue, 11 Oct 2022 23:22:22 +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:References:In-Reply-To: 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: List-Owner; bh=wiUmlUUSp0GL/tp/KbTYDu35/dhqQsPsm+cjXe+nwbU=; b=ndQePOLDOpht3y nCMjuZBLa22wrHz3GsU+ml/92KOTPmLc3OXOq9EV2mfDaTRhFK9yc6Mv6GWhXju5suj08SchGaExT xwbzuGqWE0vqnojwcx0Pmk/huXX64NdsP1TwuAm4ndLNtvMP0IA4J66EgKe+NFp5dgdDoqtm8VQed PByaYpdYO4g63jKoYDDJD13FaeAw/PDWk7AbbImh7CvYrLeekvWYmacyC4FtvKQpRbIhtsgY3S+8B Ab2yUAmmD9xqsAoHrZRnJGGoKE6XZArgkQsVZHYySPg/vMbEfYJ8q9khSiF/uyGu7u/kELWLI4eQ8 671f2+kjjg5rLtHVMSJA==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1oiOYV-006ABY-Uh; Tue, 11 Oct 2022 23:21:00 +0000 Received: from lelv0142.ext.ti.com ([198.47.23.249]) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1oiOW0-00691e-Eq for linux-arm-kernel@lists.infradead.org; Tue, 11 Oct 2022 23:18:28 +0000 Received: from fllv0034.itg.ti.com ([10.64.40.246]) by lelv0142.ext.ti.com (8.15.2/8.15.2) with ESMTP id 29BNI0HB038190; Tue, 11 Oct 2022 18:18:00 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ti.com; s=ti-com-17Q1; t=1665530280; bh=tm3z2ruXgbRd25DHbTSqLokW/IIzhIxMr7pZxOkJ4kM=; h=From:To:CC:Subject:Date:In-Reply-To:References; b=nMwx00Y9f+7VzCZH0yS0osyjXQ2uUnk+phyExdkTB3rkkOBw1YosH8CGlCwMeL/8z on3zitfsqP6QNWKFbmH2w5ZZsPEmzVa+pz/rsKpi82bI95sd6JmUS4U9Y7JsFxZrEC dE4hL7qrnselRT6HPEiIw5B036nAJPuTgGk+1b+Q= Received: from DFLE104.ent.ti.com (dfle104.ent.ti.com [10.64.6.25]) by fllv0034.itg.ti.com (8.15.2/8.15.2) with ESMTPS id 29BNI0Ym130127 (version=TLSv1.2 cipher=AES256-GCM-SHA384 bits=256 verify=FAIL); Tue, 11 Oct 2022 18:18:00 -0500 Received: from DFLE103.ent.ti.com (10.64.6.24) by DFLE104.ent.ti.com (10.64.6.25) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256_P256) id 15.1.2507.6; Tue, 11 Oct 2022 18:17:59 -0500 Received: from fllv0040.itg.ti.com (10.64.41.20) by DFLE103.ent.ti.com (10.64.6.24) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256_P256) id 15.1.2507.6 via Frontend Transport; Tue, 11 Oct 2022 18:17:59 -0500 Received: from localhost (ileaxei01-snat.itg.ti.com [10.180.69.5]) by fllv0040.itg.ti.com (8.15.2/8.15.2) with ESMTP id 29BNHxjc088353; Tue, 11 Oct 2022 18:17:59 -0500 From: Bryan Brattlof To: Rob Herring , Krzysztof Kozlowski CC: "Rafael J. Wysocki" , Daniel Lezcano , Amit Kucheria , Zhang Rui , Nishanth Menon , Vignesh Raghavendra , Tero Kristo , Keerthy , Linux Thermal , Linux Device Tree , LKML , Linux ARM , Bryan Brattlof Subject: [PATCH 03/11] thermal: k3_j72xx_bandgap: remove fuse_base from structure Date: Tue, 11 Oct 2022 18:17:19 -0500 Message-ID: <20221011231727.8090-4-bb@ti.com> X-Mailer: git-send-email 2.38.0 In-Reply-To: <20221011231727.8090-1-bb@ti.com> References: <20221011231727.8090-1-bb@ti.com> MIME-Version: 1.0 X-Developer-Signature: v=1; a=openpgp-sha256; l=3420; h=from:subject; bh=STl+ZBG+9rtQI0+MEWUEPVK+EEoCmb9xPWHIkya++N4=; b=owNCWmg5MUFZJlNZdBYa3QAAX////vf7wz+wv7rirXcqv776Fak+6+7nr+/fYkzr/bdbzf6wARkU OIeo09Q00PSAGmg0NAA0xGTTQD0gaAAAAyAaaNAMjQZPUG0jRoPSaZPIaZRBhNDJiGCNMQ0DAjQNMj CGjQyaMjQ0whiaMjEwjRhMho0GQBpoGmQNAyEPUPIjTTRtQeo09QDQeoNANGmQNHpDRo2kNGgB5Q0A AA0AaDaIeoDIPUGjJtRoBBYoFdSeZAoppCccHOL5IuWQMVxO8y2I4PQGkBIDrAaM0WsOv+jbzzG3yl jX0AP5yjHMocMRxkp6pvpoQZGbJJLMGrlrVtiHqAXSnXDB4Q5wIq/KxaZMK9vWEWYUnp+t1z8uDsD/ r8B6o+Ggp8Us03L4gZ1suTJXfevmgGwuBmvHZ3EN7nWkDKRqBIAK32pEPo1y3pLAcIiGXGA0dRyDBN Unk5zHV8IqWnsdmzxmBpkM1dHDaGCOiRL2Lx0MIOgIC/HHvGslZRn+K55UNxqE81c3WN4XD99WKdqr PeVs1A5+rSZv2LYhsGjl+E+C2jhahd0hPi36fP23hCxMVHgQMwar/PUB6I24kjndooL62UvpipS7Rk pU/X0cgXQM3ZHRByiUuhAAAJm9nteOFKbRLWfJli0hGEBBUIuRzjn+LuSKcKEg6Cw1ug== X-Developer-Key: i=bb@ti.com; a=openpgp; fpr=D3D177E40A38DF4D1853FEEF41B90D5D71D56CE0 X-EXCLAIMER-MD-CONFIG: e1e8a2fd-e40a-4ac6-ac9b-f7e9cc9ee180 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20221011_161824_652129_96025BDD X-CRM114-Status: GOOD ( 19.16 ) 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 'fuse_base' is only needed during the initial probe function to provide a software trimming method for some devices effected by TI's i2128 erratum. Not all devices that use this hardware device will need to map this eFuse region. Remove fuse_base from the main k3_j72xx_bandgap structure Signed-off-by: Bryan Brattlof --- drivers/thermal/k3_j72xx_bandgap.c | 22 +++++++++++----------- 1 file changed, 11 insertions(+), 11 deletions(-) diff --git a/drivers/thermal/k3_j72xx_bandgap.c b/drivers/thermal/k3_j72xx_bandgap.c index b9d20026771a5..99df62295a11f 100644 --- a/drivers/thermal/k3_j72xx_bandgap.c +++ b/drivers/thermal/k3_j72xx_bandgap.c @@ -177,7 +177,6 @@ struct k3_j72xx_bandgap { struct device *dev; void __iomem *base; void __iomem *cfg2_base; - void __iomem *fuse_base; struct k3_thermal_data *ts_data[K3_VTM_MAX_NUM_TS]; }; @@ -276,7 +275,7 @@ static int k3_j72xx_bandgap_temp_to_adc_code(int temp) } static void get_efuse_values(int id, struct k3_thermal_data *data, int *err, - struct k3_j72xx_bandgap *bgp) + void __iomem *fuse_base) { int i, tmp, pow; int ct_offsets[5][K3_VTM_CORRECTION_TEMP_CNT] = { @@ -298,16 +297,16 @@ static void get_efuse_values(int id, struct k3_thermal_data *data, int *err, /* Extract the offset value using bit-mask */ if (ct_offsets[id][i] == -1 && i == 1) { /* 25C offset Case of Sensor 2 split between 2 regs */ - tmp = (readl(bgp->fuse_base + 0x8) & 0xE0000000) >> (29); - tmp |= ((readl(bgp->fuse_base + 0xC) & 0x1F) << 3); + tmp = (readl(fuse_base + 0x8) & 0xE0000000) >> (29); + tmp |= ((readl(fuse_base + 0xC) & 0x1F) << 3); pow = tmp & 0x80; } else if (ct_offsets[id][i] == -1 && i == 2) { /* 125C Case of Sensor 3 split between 2 regs */ - tmp = (readl(bgp->fuse_base + 0x4) & 0xF8000000) >> (27); - tmp |= ((readl(bgp->fuse_base + 0x8) & 0xF) << 5); + tmp = (readl(fuse_base + 0x4) & 0xF8000000) >> (27); + tmp |= ((readl(fuse_base + 0x8) & 0xF) << 5); pow = tmp & 0x100; } else { - tmp = readl(bgp->fuse_base + ct_offsets[id][i]); + tmp = readl(fuse_base + ct_offsets[id][i]); tmp &= ct_bm[id][i]; tmp = tmp >> __ffs(ct_bm[id][i]); @@ -356,6 +355,7 @@ static int k3_j72xx_bandgap_probe(struct platform_device *pdev) struct thermal_zone_device *ti_thermal; int *ref_table; struct err_values err_vals; + void __iomem *fuse_base; const s64 golden_factors[] = { -490019999999999936, @@ -387,9 +387,9 @@ static int k3_j72xx_bandgap_probe(struct platform_device *pdev) return PTR_ERR(bgp->cfg2_base); res = platform_get_resource(pdev, IORESOURCE_MEM, 2); - bgp->fuse_base = devm_ioremap_resource(dev, res); - if (IS_ERR(bgp->fuse_base)) - return PTR_ERR(bgp->fuse_base); + fuse_base = devm_ioremap_resource(dev, res); + if (IS_ERR(fuse_base)) + return PTR_ERR(fuse_base); driver_data = of_device_get_match_data(dev); if (driver_data) @@ -428,7 +428,7 @@ static int k3_j72xx_bandgap_probe(struct platform_device *pdev) } /* Workaround not needed if bit30/bit31 is set even for J721e */ - if (workaround_needed && (readl(bgp->fuse_base + 0x0) & 0xc0000000) == 0xc0000000) + if (workaround_needed && (readl(fuse_base + 0x0) & 0xc0000000) == 0xc0000000) workaround_needed = false; dev_dbg(bgp->dev, "Work around %sneeded\n", From patchwork Tue Oct 11 23:17:20 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Bryan Brattlof X-Patchwork-Id: 13004516 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 98320C433FE for ; Tue, 11 Oct 2022 23:20:25 +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:References:In-Reply-To: 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: List-Owner; bh=v21GCMHz9aW7xIU75jCkXJUR6t14czlmCtEnyUJVS0k=; b=n4YgTO1fP8W1wU 5q+GAy1rThYcNiV57N132ShDjMFj5FKOGGLvstmzxCOL5k75KyfLjKHR18yfAiwxe3AjCe7yv1OZj Sk1l5wuSf3zpmeGT1RuINwz4oYE/+8FOZzqdqopx3PPTbhhYQqRWXZmDkablh3bmKH47Uwa/T0LWA Xh/ZFl8UwmsvfQ1pJzYrwoWwgusl1mnS1LBIOdRLTB3aJCjntIRPJhrEsDPsBJakHWqD1lw0nAauM JPK4Vps/An6E+lCTSKHrAYNNcPqP8dqNUOkx4bpHL/NfkU6gIknkoBO6to63CkTue9t+8bLjl4ZOb SmWeYJ+jH0/Sik5YM3xg==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1oiOWu-0069Na-Ic; Tue, 11 Oct 2022 23:19:20 +0000 Received: from lelv0143.ext.ti.com ([198.47.23.248]) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1oiOVo-0068x9-3b for linux-arm-kernel@lists.infradead.org; Tue, 11 Oct 2022 23:18:16 +0000 Received: from lelv0265.itg.ti.com ([10.180.67.224]) by lelv0143.ext.ti.com (8.15.2/8.15.2) with ESMTP id 29BNI1Xi086173; Tue, 11 Oct 2022 18:18:01 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ti.com; s=ti-com-17Q1; t=1665530281; bh=V43nL9p2UXliVj8OWhyDT5EBScWJAlDR6URDW1S2FuU=; h=From:To:CC:Subject:Date:In-Reply-To:References; b=bFyUefptAE15OpqqDUVolVxhlYQrGV7i2Rj2FGiRRcKnNzZNCsI9kdt5VbgfFw+gB 5rzkyIWfsUXHxvuLhd9tVga2518LSV0+Jn2rAmW02G2BOH0eI6uZSxGNAzG32Fy0ao kQXeJC+SHGxxyl5h4pF+pFK/oKkB3dmwKoilcDBs= Received: from DLEE112.ent.ti.com (dlee112.ent.ti.com [157.170.170.23]) by lelv0265.itg.ti.com (8.15.2/8.15.2) with ESMTPS id 29BNI18M029446 (version=TLSv1.2 cipher=AES256-GCM-SHA384 bits=256 verify=FAIL); Tue, 11 Oct 2022 18:18:01 -0500 Received: from DLEE108.ent.ti.com (157.170.170.38) by DLEE112.ent.ti.com (157.170.170.23) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256_P256) id 15.1.2507.6; Tue, 11 Oct 2022 18:18:00 -0500 Received: from lelv0326.itg.ti.com (10.180.67.84) by DLEE108.ent.ti.com (157.170.170.38) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256_P256) id 15.1.2507.6 via Frontend Transport; Tue, 11 Oct 2022 18:18:00 -0500 Received: from localhost (ileaxei01-snat2.itg.ti.com [10.180.69.6]) by lelv0326.itg.ti.com (8.15.2/8.15.2) with ESMTP id 29BNI01g021930; Tue, 11 Oct 2022 18:18:00 -0500 From: Bryan Brattlof To: Rob Herring , Krzysztof Kozlowski CC: "Rafael J. Wysocki" , Daniel Lezcano , Amit Kucheria , Zhang Rui , Nishanth Menon , Vignesh Raghavendra , Tero Kristo , Keerthy , Linux Thermal , Linux Device Tree , LKML , Linux ARM , Bryan Brattlof Subject: [PATCH 04/11] thermal: k3_j72xx_bandgap: map fuse_base only for erratum workaround Date: Tue, 11 Oct 2022 18:17:20 -0500 Message-ID: <20221011231727.8090-5-bb@ti.com> X-Mailer: git-send-email 2.38.0 In-Reply-To: <20221011231727.8090-1-bb@ti.com> References: <20221011231727.8090-1-bb@ti.com> MIME-Version: 1.0 X-Developer-Signature: v=1; a=openpgp-sha256; l=2554; h=from:subject; bh=cOO7JFWo8MUylBuZzGjwW1oumWVy8SSUhUCR4NTdink=; b=owNCWmg5MUFZJlNZr31NEgAAaX///v5df237vP/LfznzPfd/adz3Wy952+uT/3+76/3f72+wARrN hD1ADQAAZBoBoAAaGho0ADQBoDI0aAaA9QNDQGg0AaDQAZMjIYRppvVPNUOhoZBpkA0NDRoNGgNGmE aeoGjQDTQNNA9QMg0xMjQNqDTRoaaaDRoDQDI0GmgDIA4MUNNNGgeoNMRoGg9QZDEZADQAZAAAxNGJ oaA0BoBoMmhoAaZNNAAAAAALQfPrwkgDqiIEossClECe7gmIQyXd6JChFvEKbRg28WkWL9Ar20u3Fx AWZIwrEgVMqOLo4WRPGKBUwaFUbQCqCvmRxw/HkfMnS8x0itdOS5SaOLImsBpt+C4PhUoGkBe2zcUm GmNpzO1w09mrQHKkMxVhJKtffPqh2z/4uFTr0Ddkw7iXUsoce5LeBlAoSpDglqwUij2Aq0SQ5YDxdB aE/USOyOI00TKtgdUXChmvofVA7vL2RXLAc7cJcqhfnxIhzbB2ZuPpx+TEc0BAPMCgy1GB0lVvzX6L DLURSyHwS5FcpAAWskCb31zzqVLn104efkilKq0YhMSOpk7peJ1JhYxbXK1IGHBivEu6k2L6HRFbAp 8pTU8tHAyNHBIrFoFawdDz4NCH6GXPX4BqYeMyvOARhRDCVowGYEcAe2ToghD/i7kinChIV76miQA= X-Developer-Key: i=bb@ti.com; a=openpgp; fpr=D3D177E40A38DF4D1853FEEF41B90D5D71D56CE0 X-EXCLAIMER-MD-CONFIG: e1e8a2fd-e40a-4ac6-ac9b-f7e9cc9ee180 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20221011_161812_393130_68BA2B8D X-CRM114-Status: GOOD ( 16.10 ) 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 Some of TI's J721E SoCs require a software trimming procedure for the temperature monitors to function properly. To determine if a particular J721E is not affected by this erratum, both bits in the WKUP_SPARE_FUSE0 region must be set. Other SoCs, not affected by this erratum, will not need this region. Map the 'fuse_base' region only when the erratum fix is needed. Signed-off-by: Bryan Brattlof --- drivers/thermal/k3_j72xx_bandgap.c | 34 +++++++++++++++++++----------- 1 file changed, 22 insertions(+), 12 deletions(-) diff --git a/drivers/thermal/k3_j72xx_bandgap.c b/drivers/thermal/k3_j72xx_bandgap.c index 99df62295a11f..fdba116f7fe7b 100644 --- a/drivers/thermal/k3_j72xx_bandgap.c +++ b/drivers/thermal/k3_j72xx_bandgap.c @@ -386,15 +386,32 @@ static int k3_j72xx_bandgap_probe(struct platform_device *pdev) if (IS_ERR(bgp->cfg2_base)) return PTR_ERR(bgp->cfg2_base); - res = platform_get_resource(pdev, IORESOURCE_MEM, 2); - fuse_base = devm_ioremap_resource(dev, res); - if (IS_ERR(fuse_base)) - return PTR_ERR(fuse_base); - driver_data = of_device_get_match_data(dev); if (driver_data) workaround_needed = driver_data->has_errata_i2128; + /* + * Some of TI's J721E SoCs require a software trimming procedure + * for the temperature monitors to function properly. To determine + * if this particular SoC is NOT affected, both bits in the + * WKUP_SPARE_FUSE0[31:30] will be set (0xC0000000) indicating + * when software trimming should NOT be applied. + * + * https://www.ti.com/lit/er/sprz455c/sprz455c.pdf + */ + if (workaround_needed) { + res = platform_get_resource(pdev, IORESOURCE_MEM, 2); + fuse_base = devm_ioremap_resource(dev, res); + if (IS_ERR(fuse_base)) + return PTR_ERR(fuse_base); + + if ((readl(fuse_base) & 0xc0000000) == 0xc0000000) + workaround_needed = false; + } + + dev_dbg(bgp->dev, "Work around %sneeded\n", + workaround_needed ? "" : "not "); + pm_runtime_enable(dev); ret = pm_runtime_get_sync(dev); if (ret < 0) { @@ -427,13 +444,6 @@ static int k3_j72xx_bandgap_probe(struct platform_device *pdev) goto err_free_ref_table; } - /* Workaround not needed if bit30/bit31 is set even for J721e */ - if (workaround_needed && (readl(fuse_base + 0x0) & 0xc0000000) == 0xc0000000) - workaround_needed = false; - - dev_dbg(bgp->dev, "Work around %sneeded\n", - workaround_needed ? "" : "not "); - if (!workaround_needed) init_table(5, ref_table, golden_factors); else From patchwork Tue Oct 11 23:17:21 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Bryan Brattlof X-Patchwork-Id: 13004537 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 51970C4332F for ; Tue, 11 Oct 2022 23:23:22 +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:References:In-Reply-To: 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: List-Owner; bh=ETEO8VP0adYi5ONCVrTsXBAk/suqghpOeGZjRB1DHg8=; b=yeMtjpk/N1CQR1 w8hqT+L+g8bWaHHkankcSLT56O9auRnllecEJqaooGMjnPclecA77yeLdcRIt3bXcVpghs9nPmZuz tmwuFM4qKp5lhuY7m546Jsnv+iz5wKHqPlxJwEZL6baQlJPpjmoiyX6pWoMj/7Wzcz9zsrjC/yOcp 06qakX6GQbc+dPuBYeKpSzi9Hno4DV5SJ49HcBFlW+eroocFV4245Ac/gsAAaGIOP+E6BvvUBYTjM OLufJknvl/Jh/RmEo4S7iRdqs6HNLpOXg0uFwlH8Vc6D6705wZVRF4nfg4QxYRO790cYFo3eSlyTz zZOpR/Pw6zQG2tTiKd1g==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1oiOZb-006Ahg-5s; Tue, 11 Oct 2022 23:22:08 +0000 Received: from fllv0015.ext.ti.com ([198.47.19.141]) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1oiOW9-00695Z-Q3 for linux-arm-kernel@lists.infradead.org; Tue, 11 Oct 2022 23:18:35 +0000 Received: from fllv0035.itg.ti.com ([10.64.41.0]) by fllv0015.ext.ti.com (8.15.2/8.15.2) with ESMTP id 29BNIQXS005747; Tue, 11 Oct 2022 18:18:26 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ti.com; s=ti-com-17Q1; t=1665530306; bh=P1m/db96NUv+Yg/RID1mWoELUsUOMqR0M54jnmoWElo=; h=From:To:CC:Subject:Date:In-Reply-To:References; b=SSllpkkg9qtDYsVDOiXA6GfVVSytL2EUL7et14uyz3yhecLShYhnOjaGoGm8HyFyD Hc9Pz9SQHteerFajeRgzLQkwxqRn1xAS0OYUVjWelmxnWLCSicbWeRuRyJhrx3cf10 dG3CsuMhLJpKyMb76tEf/M4COfuIjtrQVM3YhTB4= Received: from DLEE112.ent.ti.com (dlee112.ent.ti.com [157.170.170.23]) by fllv0035.itg.ti.com (8.15.2/8.15.2) with ESMTPS id 29BNIQEa096544 (version=TLSv1.2 cipher=AES256-GCM-SHA384 bits=256 verify=FAIL); Tue, 11 Oct 2022 18:18:26 -0500 Received: from DLEE108.ent.ti.com (157.170.170.38) by DLEE112.ent.ti.com (157.170.170.23) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256_P256) id 15.1.2507.6; Tue, 11 Oct 2022 18:18:01 -0500 Received: from fllv0040.itg.ti.com (10.64.41.20) by DLEE108.ent.ti.com (157.170.170.38) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256_P256) id 15.1.2507.6 via Frontend Transport; Tue, 11 Oct 2022 18:18:01 -0500 Received: from localhost (ileaxei01-snat.itg.ti.com [10.180.69.5]) by fllv0040.itg.ti.com (8.15.2/8.15.2) with ESMTP id 29BNI1aA088414; Tue, 11 Oct 2022 18:18:01 -0500 From: Bryan Brattlof To: Rob Herring , Krzysztof Kozlowski CC: "Rafael J. Wysocki" , Daniel Lezcano , Amit Kucheria , Zhang Rui , Nishanth Menon , Vignesh Raghavendra , Tero Kristo , Keerthy , Linux Thermal , Linux Device Tree , LKML , Linux ARM , Bryan Brattlof Subject: [PATCH 05/11] dt-bindings: thermal: k3-j72xx: elaborate on binding descriptions Date: Tue, 11 Oct 2022 18:17:21 -0500 Message-ID: <20221011231727.8090-6-bb@ti.com> X-Mailer: git-send-email 2.38.0 In-Reply-To: <20221011231727.8090-1-bb@ti.com> References: <20221011231727.8090-1-bb@ti.com> MIME-Version: 1.0 X-Developer-Signature: v=1; a=openpgp-sha256; l=2264; h=from:subject; bh=xzPQXHc0OCTrwaaHBhCklOdKZFKQQ617QSSHOw26KN4=; b=owNCWmg5MUFZJlNZosh7uAAAY//////N9nvz/L2TNv09fJP+bx5/bue7O/u/8m//5/5v/PSwARs2 g7UAaAAAAGgDQABoAAAaZGgGjIAADQ0DTQaBk0aABo9IGRtT1GxT2VEDJk0aGgGIaGho0BkMgGQZGh poNGgADJpowBBhMQaBkBoYgaMg0yaNABg7U0yBpoGhhNAAANGgYmgAyAAA0AGT1B6EeowTI0ZGg0AB kDI0NNDQ09IMGDDw472vWL+jYN/aEBFU7IPcNoBHiI3ogAyRAVlsgEVJQ+pW/Z6IUi1AEnsL+4aL5y 86SWZFReGhzf47Hc9QMrE6IM4Ch0a+vvfYDubVZGDCLUQ3enGCs0GkX6R43SQSBMKXImP41BL76wHs efRJEwKf+Tta7yDzGDTktDchj2IkOHbTpLbfcrXYfFbd4p0dNop1LguDyOhlzcaw8bNFLITelbPMZ9 vIV/ftUnDy6/J5fgh7P0vgLxodev4WXB0ggrfL261MvYThRxniUDHlJ7JTHhDlTh/4DCPDstU4Titx pJsJStc+jUHF89wyJl0b7CZehfVKkpB8FNlsfxIgqzPTilGyTH6+p7tSyXxiKIEij8SW3sBFfixBbk DFDKPJ3HWgAIQSzV7bBmmx/XhCqef7GOaSPYLOqCwjLUJCpGJDkrDCCWAH/F3JFOFCQosh7uA= X-Developer-Key: i=bb@ti.com; a=openpgp; fpr=D3D177E40A38DF4D1853FEEF41B90D5D71D56CE0 X-EXCLAIMER-MD-CONFIG: e1e8a2fd-e40a-4ac6-ac9b-f7e9cc9ee180 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20221011_161833_988417_021C0DEF X-CRM114-Status: GOOD ( 14.52 ) 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 Elaborate on the function of this device node as well as some of the properties that this node uses. Signed-off-by: Bryan Brattlof --- .../bindings/thermal/ti,j72xx-thermal.yaml | 27 ++++++++++++++++++- 1 file changed, 26 insertions(+), 1 deletion(-) diff --git a/Documentation/devicetree/bindings/thermal/ti,j72xx-thermal.yaml b/Documentation/devicetree/bindings/thermal/ti,j72xx-thermal.yaml index c74f124ebfc00..0b6a6fa07a532 100644 --- a/Documentation/devicetree/bindings/thermal/ti,j72xx-thermal.yaml +++ b/Documentation/devicetree/bindings/thermal/ti,j72xx-thermal.yaml @@ -9,6 +9,24 @@ title: Texas Instruments J72XX VTM (DTS) binding maintainers: - Keerthy +description: | + The TI K3 family of SoCs typically have a Voltage & Thermal + Management (VTM) device to control up to 8 temperature diode + sensors to measure silicon junction temperatures from different + hotspots of the chip as well as provide temperature, interrupt + and alerting information. + + The VTM device will periodically enable these temperature sensors + to make a temperature measurement and store the reported data + allowing the sensors to stay in a reset state when not in use + to maximize the sensor's life. + + This VTM driver will then use the following polynomial equation to + calculate the temperature from the value stored in the VTM device. + + Temp = (-9.2627e-12) * x^4 + (6.0373e-08) * x^3 + \ + (-1.7058e-04) * x^2 + (3.2512e-01) * x + (-4.9003e+01) + properties: compatible: enum: @@ -19,9 +37,16 @@ properties: items: - description: VTM cfg1 register space - description: VTM cfg2 register space - - description: VTM efuse register space + - description: | + A software trimming method must be applied to some Jacinto + devices to function properly. This eFuse region provides + the information needed for these SoCs to report + temperatures accurately. power-domains: + description: | + Should contain the phandle to a power management (PM) domain + node and the device-id of this device. maxItems: 1 "#thermal-sensor-cells": From patchwork Tue Oct 11 23:17:22 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Bryan Brattlof X-Patchwork-Id: 13004512 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 8B9C8C433FE for ; Tue, 11 Oct 2022 23:19:32 +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:References:In-Reply-To: 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: List-Owner; bh=dDsieH257B05UDnPl/0wmt+gZY4+d8IBkmGMBRZjoRo=; b=i0HA85PWdk0bjO BNRvBa5LZSCuqF1LujNz9M/NoJOd/YNMm3Fk3mBi8O/+ZfNgX+OEAsi7I3f81F3TfizENppuVPxmr e5hbZkcoV6RemxQ/BqdudYA7KngcWHGhBx0EEjmrhdGXAkJmPUhbgw9zjUMWIs+vjkx1gbjSuo7PT ll/NMIYKHT6NYlm4vitYYlLUJkLa8rMwafoTXxw0riAvi7DQxCri2DenycmlZokJs1+ETV2dGUaTd KBlO9p9m1KPWH8cc7By53zvAXwi+SpD8QBy3E1qUE+l/EWed3SddukQMOFSXIIyc/TTZva11biOB+ M/t0A99mVItBiJK41O8g==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1oiOW8-006956-80; Tue, 11 Oct 2022 23:18:32 +0000 Received: from fllv0015.ext.ti.com ([198.47.19.141]) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1oiOVn-0068xl-Ra for linux-arm-kernel@lists.infradead.org; Tue, 11 Oct 2022 23:18:13 +0000 Received: from lelv0265.itg.ti.com ([10.180.67.224]) by fllv0015.ext.ti.com (8.15.2/8.15.2) with ESMTP id 29BNI3pK005692; Tue, 11 Oct 2022 18:18:03 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ti.com; s=ti-com-17Q1; t=1665530283; bh=cR268UZvfBM1FlE0yMkmHq1DV0bRnQaCFdVx4NiAZW4=; h=From:To:CC:Subject:Date:In-Reply-To:References; b=Ah50Newn2/6TzODu00VwBWZPIwRtC80EfIxafxg1VS9j9fIQzVUSOM0obubjjejSC gqNWnxcOrkmxFg2L15V2WPsDKJ4n9DMUJbRSQk7m/AoIsfVpV1c/SGTEETr1ccR1Xx X/jHs0B6Gvtyx4xksXaWxq1WlvWBwd2qRrYCmZb4= Received: from DFLE114.ent.ti.com (dfle114.ent.ti.com [10.64.6.35]) by lelv0265.itg.ti.com (8.15.2/8.15.2) with ESMTPS id 29BNI386029505 (version=TLSv1.2 cipher=AES256-GCM-SHA384 bits=256 verify=FAIL); Tue, 11 Oct 2022 18:18:03 -0500 Received: from DFLE113.ent.ti.com (10.64.6.34) by DFLE114.ent.ti.com (10.64.6.35) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256_P256) id 15.1.2507.6; Tue, 11 Oct 2022 18:18:02 -0500 Received: from lelv0327.itg.ti.com (10.180.67.183) by DFLE113.ent.ti.com (10.64.6.34) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256_P256) id 15.1.2507.6 via Frontend Transport; Tue, 11 Oct 2022 18:18:02 -0500 Received: from localhost (ileaxei01-snat.itg.ti.com [10.180.69.5]) by lelv0327.itg.ti.com (8.15.2/8.15.2) with ESMTP id 29BNI2bQ059088; Tue, 11 Oct 2022 18:18:02 -0500 From: Bryan Brattlof To: Rob Herring , Krzysztof Kozlowski CC: "Rafael J. Wysocki" , Daniel Lezcano , Amit Kucheria , Zhang Rui , Nishanth Menon , Vignesh Raghavendra , Tero Kristo , Keerthy , Linux Thermal , Linux Device Tree , LKML , Linux ARM , Bryan Brattlof Subject: [PATCH 06/11] dt-bindings: thermal: k3-j72xx: conditionally require efuse reg range Date: Tue, 11 Oct 2022 18:17:22 -0500 Message-ID: <20221011231727.8090-7-bb@ti.com> X-Mailer: git-send-email 2.38.0 In-Reply-To: <20221011231727.8090-1-bb@ti.com> References: <20221011231727.8090-1-bb@ti.com> MIME-Version: 1.0 X-Developer-Signature: v=1; a=openpgp-sha256; l=2213; h=from:subject; bh=392o2SIsDC1TRw+VXUL68Q4QmibPK2Rjnky1U7t/3gE=; b=owNCWmg5MUFZJlNZGbDbUgAAan/////9+uvvzcru7OcZ+4c+2U362e1//9+R93z8/bXO+vewARsw IeoDQAaNNAB6QAaANAAaNNMQDQxDQAaGIDQABoNNNGjE0DTTQeptQ2jUbU/VDoaaZGmjIDJkAAaAZP QhoAZGgaBoaaAGTIxMJ6gaBkNDIwjI9TEGmhkBpoAdNMTQyMjQwgGmgaDJppphNAGhoAYhk0wRoyGB MJhAAAYgMEAAaDQABg8IMdCJgQiNnz8TIkuavngDGMNCq0/DEXAsUAs1sGIyFfRtD4fhmgu8kWYdov xguio2arETPjgAr10QiqFfLxFimu4m2IbQjOBdPkJrQ8HgQDdKsaFLr6aK6k6fIK42nt+5ZhbdbpPb PHBxv4+gng2490wMxfvp8kMwC2PgDLOOYDdACNO16WMsDqgQkb0ixfqOxbAUVe5NlSOBA3oVM8rQpD SruWyBMFTh3wCo3G7B7h1NGjjRInfxIzIeO5oiM1Y1X5aulQEUa38bWZY0+p2J7ADH62BwoxIxU8yf AFbomYriq2fU2XL+Pw0SjsDGcNlKHrW3hK9Y0bKUjUFrALGqUgdCLUImbLJJBHqwIPhmgFN35HEf1y 6cC8hmqpMu9LQxp/uxDDt8g4ycMQBx9cTnUZDkj+C0IR0LGlZn+rT7gAP8XckU4UJAZsNtSA== X-Developer-Key: i=bb@ti.com; a=openpgp; fpr=D3D177E40A38DF4D1853FEEF41B90D5D71D56CE0 X-EXCLAIMER-MD-CONFIG: e1e8a2fd-e40a-4ac6-ac9b-f7e9cc9ee180 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20221011_161812_025232_9E6D45E7 X-CRM114-Status: GOOD ( 10.15 ) 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 Only some of TI's J721E SoCs will need a eFuse register range mapped to determine if they're affected by TI's i2128 erratum. All other SoC will not need this eFuse range to be mapped to function properly Update the bindings for the k3_j72xx_bandgap thermal driver so other devices will only need to define two register ranges Signed-off-by: Bryan Brattlof --- .../bindings/thermal/ti,j72xx-thermal.yaml | 34 +++++++++++++------ 1 file changed, 24 insertions(+), 10 deletions(-) diff --git a/Documentation/devicetree/bindings/thermal/ti,j72xx-thermal.yaml b/Documentation/devicetree/bindings/thermal/ti,j72xx-thermal.yaml index 0b6a6fa07a532..387628ab35959 100644 --- a/Documentation/devicetree/bindings/thermal/ti,j72xx-thermal.yaml +++ b/Documentation/devicetree/bindings/thermal/ti,j72xx-thermal.yaml @@ -33,16 +33,6 @@ properties: - ti,j721e-vtm - ti,j7200-vtm - reg: - items: - - description: VTM cfg1 register space - - description: VTM cfg2 register space - - description: | - A software trimming method must be applied to some Jacinto - devices to function properly. This eFuse region provides - the information needed for these SoCs to report - temperatures accurately. - power-domains: description: | Should contain the phandle to a power management (PM) domain @@ -52,6 +42,30 @@ properties: "#thermal-sensor-cells": const: 1 +if: + properties: + compatible: + contains: + enum: + - ti,j721e-vtm +then: + properties: + reg: + items: + - description: VTM cfg1 register space + - description: VTM cfg2 register space + - description: | + A software trimming method must be applied to some Jacinto + devices to function properly. This eFuse region provides + the information needed for these SoCs to report + temperatures accurately. +else: + properties: + reg: + items: + - description: VTM cfg1 register space + - description: VTM cfg2 register space + required: - compatible - reg From patchwork Tue Oct 11 23:17:23 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Bryan Brattlof X-Patchwork-Id: 13004515 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 B18F2C433FE for ; Tue, 11 Oct 2022 23:20:05 +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:References:In-Reply-To: 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: List-Owner; bh=5kas7iIniyKasDg7+mV30ipxtONNTuA/XaDuoHTqSok=; b=iR5bK9+fXCuL8J Q6fy75NvrwZDNp0Q1ZXk+taHPa2fYG9HyLtsl6ETRlycHWXsBbqNNJbJZu64ytw3wirGhScYhBsPT ckvBDCNMfLgJbg2w8uOG0CkJF1taQi8XdOZeuPyvCXgQrZq9jtFkXTOrgrAt3eJDxkv6IQUa0WK9Z t6YOIHeDevaIDK1Yub62uoeXIVhaDXNZ1vVXtCm6gOfvKs1af/RVXaiGIMWyv+RqoznxThgymWcL5 UkD/OcfSAQFsM3+XPBdF3WSefMvFXhXl4Q4OkYGvTMN0Xs8+VrymcyWN/EDCx/99rwgs89d1wXdnM bRMrR/AlQjcx8+6RN5dg==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1oiOWg-0069HC-R6; Tue, 11 Oct 2022 23:19:07 +0000 Received: from lelv0143.ext.ti.com ([198.47.23.248]) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1oiOVo-0068wm-3c for linux-arm-kernel@lists.infradead.org; Tue, 11 Oct 2022 23:18:15 +0000 Received: from fllv0035.itg.ti.com ([10.64.41.0]) by lelv0143.ext.ti.com (8.15.2/8.15.2) with ESMTP id 29BNI4CN086187; Tue, 11 Oct 2022 18:18:04 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ti.com; s=ti-com-17Q1; t=1665530284; bh=6o1KqrZ+fXEMS7aaZARPQ/NnoBxO34uPUaUPmbI+thE=; h=From:To:CC:Subject:Date:In-Reply-To:References; b=BwpJsVD1lZ6mO65P1Pvpa5krJOoy0K0Z1pqoyJvYH4M4cJo09CUocCWwFpaMfm/5l fSkSecXQMDhnNG5ODNSVYyRciyMIWsH30Ko700SpBvETIF9xqYKnFQllLSPv7TdGgc GA4XeZuEpQfjdnLjWd/vxeummEOXZGst16nolTmM= Received: from DFLE101.ent.ti.com (dfle101.ent.ti.com [10.64.6.22]) by fllv0035.itg.ti.com (8.15.2/8.15.2) with ESMTPS id 29BNI4Eq096425 (version=TLSv1.2 cipher=AES256-GCM-SHA384 bits=256 verify=FAIL); Tue, 11 Oct 2022 18:18:04 -0500 Received: from DFLE114.ent.ti.com (10.64.6.35) by DFLE101.ent.ti.com (10.64.6.22) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256_P256) id 15.1.2507.6; Tue, 11 Oct 2022 18:18:03 -0500 Received: from lelv0326.itg.ti.com (10.180.67.84) by DFLE114.ent.ti.com (10.64.6.35) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256_P256) id 15.1.2507.6 via Frontend Transport; Tue, 11 Oct 2022 18:18:03 -0500 Received: from localhost (ileaxei01-snat2.itg.ti.com [10.180.69.6]) by lelv0326.itg.ti.com (8.15.2/8.15.2) with ESMTP id 29BNI3e2022106; Tue, 11 Oct 2022 18:18:03 -0500 From: Bryan Brattlof To: Rob Herring , Krzysztof Kozlowski CC: "Rafael J. Wysocki" , Daniel Lezcano , Amit Kucheria , Zhang Rui , Nishanth Menon , Vignesh Raghavendra , Tero Kristo , Keerthy , Linux Thermal , Linux Device Tree , LKML , Linux ARM , Bryan Brattlof Subject: [PATCH 07/11] arm64: dts: ti: k3-am64-main: add VTM node Date: Tue, 11 Oct 2022 18:17:23 -0500 Message-ID: <20221011231727.8090-8-bb@ti.com> X-Mailer: git-send-email 2.38.0 In-Reply-To: <20221011231727.8090-1-bb@ti.com> References: <20221011231727.8090-1-bb@ti.com> MIME-Version: 1.0 X-Developer-Signature: v=1; a=openpgp-sha256; l=3254; h=from:subject; bh=HE07q6h/VkPG0znQw7MNm8QBZyEJDwtYuYDWFc4WF+Y=; b=owNCWmg5MUFZJlNZN0wH+AAAZX////7/fmVp+/67D0Zdn99/x7+/4e+3///Tf/97191v8/ywARsw HajQaBoaaAaGmgZBoaYmgADQABoGmg0AGgA00GhpoANDRpoNDRgg0aMhow0IgaAANAA0NMgaAABkPU yGmhkGJkaNAGTQDIAPUAaDR6JjU0HqAYRoBoGgAHJp6Q00NDTINGgDEGQGIGg0aNA0aNDRkyAAaAAy AMQNNAAAaA0xAGAhkAAFiHMMHK2AeZF2IiSM6tJ/g4eH35fdMcsqgEw0C+gmlZ4AyuGzwB+TsMjnsD CxkdOl4ZhpgXwjuzfwGQWaBZh1ga5OTUB02504PJDijVsekUCVZSpgrVgfQ9lUmgmYpLxsRzQyNcB5 OCkpx/CE5qLQ4ub6LLR6SJHQrN1Ifn0RP3owYkQT1xQeY0GPixgg8cNG4Ef1mT6pAFG5RLduO5H0pE aVEJCghA6RQWs074zDQCTgIouzf/K3QTzRA3SmUx0TiB+ZWO7ST+7fRzvfeFEuKjxpQYL8vAqCAdUF 8toyFL5JahTKmdovtVNsCpn79Tp4CiNrCHsu/ec1SN5aUYMK9AvELlzqnuSRoc45AhCsWxQApXUs/k BivqibNybpGFMAThdi9srFqxPFAftK5+MYDrAiDDSObYLUKA1CLcVYcak8ZtYEcL/F3JFOFCQN0wH+ AA== X-Developer-Key: i=bb@ti.com; a=openpgp; fpr=D3D177E40A38DF4D1853FEEF41B90D5D71D56CE0 X-EXCLAIMER-MD-CONFIG: e1e8a2fd-e40a-4ac6-ac9b-f7e9cc9ee180 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20221011_161812_331206_919E847D X-CRM114-Status: GOOD ( 15.99 ) 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 The am64x supports a single VTM module which is located in the main domain with two associated temperature monitors located at different hot spots on the die. Signed-off-by: Bryan Brattlof --- arch/arm64/boot/dts/ti/k3-am64-main.dtsi | 8 +++++ arch/arm64/boot/dts/ti/k3-am64-thermal.dtsi | 33 +++++++++++++++++++++ arch/arm64/boot/dts/ti/k3-am64.dtsi | 4 +++ 3 files changed, 45 insertions(+) create mode 100644 arch/arm64/boot/dts/ti/k3-am64-thermal.dtsi diff --git a/arch/arm64/boot/dts/ti/k3-am64-main.dtsi b/arch/arm64/boot/dts/ti/k3-am64-main.dtsi index ada00575f0f2e..4cd687cc44d9e 100644 --- a/arch/arm64/boot/dts/ti/k3-am64-main.dtsi +++ b/arch/arm64/boot/dts/ti/k3-am64-main.dtsi @@ -1308,4 +1308,12 @@ main_mcan1: can@20711000 { interrupt-names = "int0", "int1"; bosch,mram-cfg = <0x0 128 64 64 64 64 32 32>; }; + + vtm0: temperature-sensor@b00000 { + compatible = "ti,j7200-vtm"; + reg = <0x00 0xb00000 0x00 0x400>, + <0x00 0xb01000 0x00 0x400>; + power-domains = <&k3_pds 95 TI_SCI_PD_EXCLUSIVE>; + #thermal-sensor-cells = <1>; + }; }; diff --git a/arch/arm64/boot/dts/ti/k3-am64-thermal.dtsi b/arch/arm64/boot/dts/ti/k3-am64-thermal.dtsi new file mode 100644 index 0000000000000..1819a6948b19d --- /dev/null +++ b/arch/arm64/boot/dts/ti/k3-am64-thermal.dtsi @@ -0,0 +1,33 @@ +// SPDX-License-Identifier: GPL-2.0 + +#include + +thermal_zones: thermal-zones { + main0_thermal: main0-thermal { + polling-delay-passive = <250>; /* milliSeconds */ + polling-delay = <500>; /* milliSeconds */ + thermal-sensors = <&vtm0 0>; + + trips { + main0_crit: main0-crit { + temperature = <105000>; /* milliCelsius */ + hysteresis = <2000>; /* milliCelsius */ + type = "critical"; + }; + }; + }; + + main1_thermal: main1-thermal { + polling-delay-passive = <250>; /* milliSeconds */ + polling-delay = <500>; /* milliSeconds */ + thermal-sensors = <&vtm0 1>; + + trips { + main1_crit: main1-crit { + temperature = <105000>; /* milliCelsius */ + hysteresis = <2000>; /* milliCelsius */ + type = "critical"; + }; + }; + }; +}; diff --git a/arch/arm64/boot/dts/ti/k3-am64.dtsi b/arch/arm64/boot/dts/ti/k3-am64.dtsi index 016dd8511ca6f..4ebee0be648e0 100644 --- a/arch/arm64/boot/dts/ti/k3-am64.dtsi +++ b/arch/arm64/boot/dts/ti/k3-am64.dtsi @@ -69,6 +69,7 @@ cbass_main: bus@f4000 { <0x00 0x00420000 0x00 0x00420000 0x00 0x00001000>, /* ESM0 */ <0x00 0x00600000 0x00 0x00600000 0x00 0x00001100>, /* GPIO */ <0x00 0x00a40000 0x00 0x00a40000 0x00 0x00000800>, /* Timesync router */ + <0x00 0x00b00000 0x00 0x00b00000 0x00 0x00002400>, /* VTM */ <0x00 0x01000000 0x00 0x01000000 0x00 0x02330400>, /* First peripheral window */ <0x00 0x08000000 0x00 0x08000000 0x00 0x00200000>, /* Main CPSW */ <0x00 0x0d000000 0x00 0x0d000000 0x00 0x00800000>, /* PCIE_CORE */ @@ -104,6 +105,9 @@ cbass_mcu: bus@4000000 { ranges = <0x00 0x04000000 0x00 0x04000000 0x00 0x01ff1400>; /* Peripheral window */ }; }; + + #include "k3-am64-thermal.dtsi" + }; /* Now include the peripherals for each bus segments */ From patchwork Tue Oct 11 23:17:24 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Bryan Brattlof X-Patchwork-Id: 13004517 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 C85FEC4332F for ; Tue, 11 Oct 2022 23:20:42 +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:References:In-Reply-To: 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: List-Owner; bh=42YBERh8systQEnbpr1lqeR6anO1tEY2COaguzXDcw0=; b=apnN0tkUbwljWK +GqCMEq5fHXBO4hs6eBGjHeUAHeYJE5NKez0o3JXqnjv5kdmMf1IWxmK0uwKiPsM8QDTP3hReOx9P 1/mks2DG3j143dLP9YBpFeKkVaOy+RbnR2t+/YNDld8IrewSMNtZSjOG25RhGySAIncBUxEtO2+H9 EssqZBBc5stxjR5EE+t9XQXUi2WjuieIfjMt+AG881OrBfy5ZOavQxO1g4UHDQlKhAXJvUG+AYl4S yyU1dV9uwb8Oh4YV1xToHAIOUjVFfMMmCIrdFtOJAVCbpiSo0h9JztoYNLIJPm8es8quv6Fd7lIUB 0p3VSuutfuZqLXraF2Tg==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1oiOXC-0069Wd-Gf; Tue, 11 Oct 2022 23:19:38 +0000 Received: from fllv0016.ext.ti.com ([198.47.19.142]) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1oiOVt-0068zi-JH for linux-arm-kernel@lists.infradead.org; Tue, 11 Oct 2022 23:18:19 +0000 Received: from fllv0034.itg.ti.com ([10.64.40.246]) by fllv0016.ext.ti.com (8.15.2/8.15.2) with ESMTP id 29BNI57D087596; Tue, 11 Oct 2022 18:18:05 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ti.com; s=ti-com-17Q1; t=1665530285; bh=jUNAK1LH+Kz9Qe/YJaSDQ69ikOIfmhp6b86sLuEeeYo=; h=From:To:CC:Subject:Date:In-Reply-To:References; b=TZKHMIKR1veBP6XMoABLoPIXMjjlRnm2z3N+r1KazZGVUz9KqVcaJp6H5SsUC28qD e/J3KRIK7iHNV/dYBfg2QuZgwakLhaQJBGuJzBKKvMV9jCQnUiEMG/baTlMujMegw4 vamLCJV8isWoRKAvrBzoR/z/iYz/84AeMVlTIIsQ= Received: from DFLE105.ent.ti.com (dfle105.ent.ti.com [10.64.6.26]) by fllv0034.itg.ti.com (8.15.2/8.15.2) with ESMTPS id 29BNI5aB130202 (version=TLSv1.2 cipher=AES256-GCM-SHA384 bits=256 verify=FAIL); Tue, 11 Oct 2022 18:18:05 -0500 Received: from DFLE113.ent.ti.com (10.64.6.34) by DFLE105.ent.ti.com (10.64.6.26) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256_P256) id 15.1.2507.6; Tue, 11 Oct 2022 18:18:04 -0500 Received: from fllv0039.itg.ti.com (10.64.41.19) by DFLE113.ent.ti.com (10.64.6.34) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256_P256) id 15.1.2507.6 via Frontend Transport; Tue, 11 Oct 2022 18:18:04 -0500 Received: from localhost (ileaxei01-snat.itg.ti.com [10.180.69.5]) by fllv0039.itg.ti.com (8.15.2/8.15.2) with ESMTP id 29BNI4iY019294; Tue, 11 Oct 2022 18:18:04 -0500 From: Bryan Brattlof To: Rob Herring , Krzysztof Kozlowski CC: "Rafael J. Wysocki" , Daniel Lezcano , Amit Kucheria , Zhang Rui , Nishanth Menon , Vignesh Raghavendra , Tero Kristo , Keerthy , Linux Thermal , Linux Device Tree , LKML , Linux ARM , Bryan Brattlof Subject: [PATCH 08/11] arm64: dts: ti: k3-am62-wakeup: add VTM node Date: Tue, 11 Oct 2022 18:17:24 -0500 Message-ID: <20221011231727.8090-9-bb@ti.com> X-Mailer: git-send-email 2.38.0 In-Reply-To: <20221011231727.8090-1-bb@ti.com> References: <20221011231727.8090-1-bb@ti.com> MIME-Version: 1.0 X-Developer-Signature: v=1; a=openpgp-sha256; l=3321; h=from:subject; bh=3SwwZw3B+jRGmn68A/SGYmeFVf6idBvVtZYlVu4q7IU=; b=owNCWmg5MUFZJlNZebrKHwAAZP///7//3237yf/75J1pf/um3X3n62+7fvfffz9evZVa//UwARsx o5D1DQHqaAADRoA0aAA0DQGmgAaA0AGgGgABkNA0aaPSA0ND1MgepptQzKbREAaaNBkGQBkaANNDQA yBoNAABkAyeiYgMRpoxMg9QbUNMmgANGJpoAaAyMO1Gag000YgGgaNMRiaANDIZNADIA0yaAABo0DI yBk000DI0ANAGgAMgB5QUKtxdIC83fkCJeHs0RiQZjvtcgWPGiE1jFthB/Mc8O4r6JoS+E3bePoCfl 45WrYtnv36SSG4BjLYLtpAXESypn5mBx6gPR4EflICyWhpY3loiOzc3Tw2fQKySaWQT147CtO6IwNH ESGcAalYUTNqV1yH+rTppkTEenOKzG/WIaQx0qq8uFUJyRYSPxVTQBwi1G738+o7jZQP3UFTYl3Jow UakM0rZEittPpg0B9YlSOlVW+mKg5VrFjgg3EEEIaShMBnA45rOY9+GUhcoNEKheEhStEo4UdETCMD riC26qDSB+eniZT0WYev2rOmDJceDWIs+B12oomZOqf6pFy84BwALxZ48CRmeXHz/A6EW+JmmVG3Lg Ta5vjOlslaHoH5zxIH1Lzn8GENZUwRL7CfoVBHY6fOwA50I9yc9oAGzJM06HQyQDv+LuSKcKEg83WU Pg== X-Developer-Key: i=bb@ti.com; a=openpgp; fpr=D3D177E40A38DF4D1853FEEF41B90D5D71D56CE0 X-EXCLAIMER-MD-CONFIG: e1e8a2fd-e40a-4ac6-ac9b-f7e9cc9ee180 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20221011_161817_816405_BA77282A X-CRM114-Status: GOOD ( 14.93 ) 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 The am62x supports a single Voltage and Thermal Management (VTM) module located in the wakeup domain with two associated temperature monitors located in hot spots of the die. Signed-off-by: Bryan Brattlof --- arch/arm64/boot/dts/ti/k3-am62-thermal.dtsi | 33 +++++++++++++++++++++ arch/arm64/boot/dts/ti/k3-am62-wakeup.dtsi | 8 +++++ arch/arm64/boot/dts/ti/k3-am62.dtsi | 7 ++++- 3 files changed, 47 insertions(+), 1 deletion(-) create mode 100644 arch/arm64/boot/dts/ti/k3-am62-thermal.dtsi diff --git a/arch/arm64/boot/dts/ti/k3-am62-thermal.dtsi b/arch/arm64/boot/dts/ti/k3-am62-thermal.dtsi new file mode 100644 index 0000000000000..1819a6948b19d --- /dev/null +++ b/arch/arm64/boot/dts/ti/k3-am62-thermal.dtsi @@ -0,0 +1,33 @@ +// SPDX-License-Identifier: GPL-2.0 + +#include + +thermal_zones: thermal-zones { + main0_thermal: main0-thermal { + polling-delay-passive = <250>; /* milliSeconds */ + polling-delay = <500>; /* milliSeconds */ + thermal-sensors = <&vtm0 0>; + + trips { + main0_crit: main0-crit { + temperature = <105000>; /* milliCelsius */ + hysteresis = <2000>; /* milliCelsius */ + type = "critical"; + }; + }; + }; + + main1_thermal: main1-thermal { + polling-delay-passive = <250>; /* milliSeconds */ + polling-delay = <500>; /* milliSeconds */ + thermal-sensors = <&vtm0 1>; + + trips { + main1_crit: main1-crit { + temperature = <105000>; /* milliCelsius */ + hysteresis = <2000>; /* milliCelsius */ + type = "critical"; + }; + }; + }; +}; diff --git a/arch/arm64/boot/dts/ti/k3-am62-wakeup.dtsi b/arch/arm64/boot/dts/ti/k3-am62-wakeup.dtsi index 4090134676cf6..3954a73a33f35 100644 --- a/arch/arm64/boot/dts/ti/k3-am62-wakeup.dtsi +++ b/arch/arm64/boot/dts/ti/k3-am62-wakeup.dtsi @@ -38,4 +38,12 @@ wkup_i2c0: i2c@2b200000 { clocks = <&k3_clks 107 4>; clock-names = "fck"; }; + + vtm0: temperature-sensor@b00000 { + compatible = "ti,j7200-vtm"; + reg = <0x00 0xb00000 0x00 0x400>, + <0x00 0xb01000 0x00 0x400>; + power-domains = <&k3_pds 95 TI_SCI_PD_EXCLUSIVE>; + #thermal-sensor-cells = <1>; + }; }; diff --git a/arch/arm64/boot/dts/ti/k3-am62.dtsi b/arch/arm64/boot/dts/ti/k3-am62.dtsi index 37fcbe7a3c336..1795f3ee534e0 100644 --- a/arch/arm64/boot/dts/ti/k3-am62.dtsi +++ b/arch/arm64/boot/dts/ti/k3-am62.dtsi @@ -80,6 +80,7 @@ cbass_main: bus@f0000 { <0x00 0x04000000 0x00 0x04000000 0x00 0x01ff1400>, /* Wakeup Domain Range */ + <0x00 0x00b00000 0x00 0x00b00000 0x00 0x00002400>, /* VTM */ <0x00 0x2b000000 0x00 0x2b000000 0x00 0x00300400>, <0x00 0x43000000 0x00 0x43000000 0x00 0x00020000>; @@ -94,10 +95,14 @@ cbass_wakeup: bus@2b000000 { compatible = "simple-bus"; #address-cells = <2>; #size-cells = <2>; - ranges = <0x00 0x2b000000 0x00 0x2b000000 0x00 0x00300400>, /* Peripheral Window */ + ranges = <0x00 0x00b00000 0x00 0x00b00000 0x00 0x00002400>, /* VTM */ + <0x00 0x2b000000 0x00 0x2b000000 0x00 0x00300400>, /* Peripheral Window */ <0x00 0x43000000 0x00 0x43000000 0x00 0x00020000>; }; }; + + #include "k3-am62-thermal.dtsi" + }; /* Now include the peripherals for each bus segments */ From patchwork Tue Oct 11 23:17:25 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Bryan Brattlof X-Patchwork-Id: 13004536 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 78E6FC433FE for ; Tue, 11 Oct 2022 23:22:43 +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:References:In-Reply-To: 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: List-Owner; bh=X/f+omJ624+S8Osa6P8Xj+CsNnBUTiS6xpR3ItylJ1g=; b=1KsCr+LEE/NIyh eGNXllz8opgG4WJyd7V92xhMbbTXNaiscvTuk9RRY65Zhhsg9wh1LBjvh/Nth8QS8vuol+gg/CAL6 MFC7zr2JAbIsErgKZ/+ySs6OngWbsNKdw0OdgE3ZUGnKtZ31YxWAlpcLWVBaS6uDmuJ8APEyz6Mbx 6++9iDx0BX+D6dj1/GNMziXVIlfxUPTjYU75WkiAT4X1hIU7CT2pIqrS+MbtFNbyyiV6D9suYKCsc jkjkezZpaED4oVBOUuEAj0qZGIBP87puL+Cfxj44Jxpc3ancvy4Xd6ZXCoHJPzyxT/UqLYkfexO0Z DwwUBL+WBgmV8HHH4Eeg==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1oiOYw-006ANg-9S; Tue, 11 Oct 2022 23:21:26 +0000 Received: from lelv0143.ext.ti.com ([198.47.23.248]) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1oiOW2-00693X-Jh for linux-arm-kernel@lists.infradead.org; Tue, 11 Oct 2022 23:18:29 +0000 Received: from fllv0034.itg.ti.com ([10.64.40.246]) by lelv0143.ext.ti.com (8.15.2/8.15.2) with ESMTP id 29BNI68G086193; Tue, 11 Oct 2022 18:18:06 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ti.com; s=ti-com-17Q1; t=1665530286; bh=1VQb9sSQ2N0jAJ/+8SjEqwFBbLtyASYrM88L0xTh3os=; h=From:To:CC:Subject:Date:In-Reply-To:References; b=NCXoX/7jcTxbFd0nz9aScLBn52zqTSswMNfygYQZ42Q09aW8sDH4TOyEN8M4CR43w R6I0qoHvF5Y3BsXCmt1X5kitaxCZZfFBUDXpJUz6cP0ecSsptNUNERshxyuG6J1ftJ 5NdL05/FyXMGAHW4yF+XFRmISqzuMrCkGmOK5dvk= Received: from DFLE111.ent.ti.com (dfle111.ent.ti.com [10.64.6.32]) by fllv0034.itg.ti.com (8.15.2/8.15.2) with ESMTPS id 29BNI6NJ130209 (version=TLSv1.2 cipher=AES256-GCM-SHA384 bits=256 verify=FAIL); Tue, 11 Oct 2022 18:18:06 -0500 Received: from DFLE102.ent.ti.com (10.64.6.23) by DFLE111.ent.ti.com (10.64.6.32) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256_P256) id 15.1.2507.6; Tue, 11 Oct 2022 18:18:05 -0500 Received: from lelv0327.itg.ti.com (10.180.67.183) by DFLE102.ent.ti.com (10.64.6.23) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256_P256) id 15.1.2507.6 via Frontend Transport; Tue, 11 Oct 2022 18:18:05 -0500 Received: from localhost (ileaxei01-snat2.itg.ti.com [10.180.69.6]) by lelv0327.itg.ti.com (8.15.2/8.15.2) with ESMTP id 29BNI5UZ059153; Tue, 11 Oct 2022 18:18:05 -0500 From: Bryan Brattlof To: Rob Herring , Krzysztof Kozlowski CC: "Rafael J. Wysocki" , Daniel Lezcano , Amit Kucheria , Zhang Rui , Nishanth Menon , Vignesh Raghavendra , Tero Kristo , Keerthy , Linux Thermal , Linux Device Tree , LKML , Linux ARM , Bryan Brattlof Subject: [PATCH 09/11] arm64: dts: ti: k3-j721e-mcu-wakeup: add VTM node Date: Tue, 11 Oct 2022 18:17:25 -0500 Message-ID: <20221011231727.8090-10-bb@ti.com> X-Mailer: git-send-email 2.38.0 In-Reply-To: <20221011231727.8090-1-bb@ti.com> References: <20221011231727.8090-1-bb@ti.com> MIME-Version: 1.0 X-Developer-Signature: v=1; a=openpgp-sha256; l=3842; h=from:subject; bh=JEEFlpPx89b1YLPv5hCqDO7AXnV4wMWyq9ffze9gykk=; b=owNCWmg5MUFZJlNZPDkluwAAZ3////99R+eu+E2emfp//X9f3zrn278822Pvefv+r/3t93ewARsr Yg0aZDQaDRoDQaNNDIAZDRoNNGQ0YmTTRoZAAADIA00aDIGmmTQBoyZM1BvUgBADRoANAPUAAA0Hog aDIyAaNBoNqAAaDagDBHqNMj1ANAPUD1GQaAyMj0TIYoZppNPUxBoGgPUaNAAAep6gAANBpoA0AGgB ppoBkAaDQNBoABoAaPUPFDBhOcj5ywEDtQj4jdUQqwUKQW3vjJ9dCrYnrZQld0AB7mBJwm+pGRLx/p kyBKFhl7EGSKRBB8tQeQA6HRBHWQ5oLjR8MB1FxrR7rsy/A/UhVbdkk51qxUHj2bxBCo9WKJNwiEzL mfYnHMAo/btbdy0M/Z5eAgPdWfabLfa1kbEsrMM/jGL1kFoiHcpnuvCZgZghh1JNYj4w7NQktBOJid NkwHYu52p54Vi+HNgGTRNJQLT76wuafa3g2gK9WuzjTADDIwPD+FNjvRzE707idIymwwnc0DOTaZvJ 9C1sL2Fci2BCOMdfiCPwR0mW7TRAKAJ/fgJnEvX9x5li0PposIEM4O8LYy39woEaB5+Y7P2gUf4uLQ fxx794YhSDVlIvt8VhDiEGrEoUj9KKSSwpKWdLTZcTVA3yoAuZZ9JXeMnLD/xdyRThQkDw5Jbs X-Developer-Key: i=bb@ti.com; a=openpgp; fpr=D3D177E40A38DF4D1853FEEF41B90D5D71D56CE0 X-EXCLAIMER-MD-CONFIG: e1e8a2fd-e40a-4ac6-ac9b-f7e9cc9ee180 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20221011_161826_809245_91E356A4 X-CRM114-Status: GOOD ( 14.22 ) 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 The j721e supports a single Voltage and Thermal Management (VTM) module located in the wakeup domain with five associated temperature monitors located in various hot spots on the die. Signed-off-by: Bryan Brattlof --- .../boot/dts/ti/k3-j721e-mcu-wakeup.dtsi | 9 +++ arch/arm64/boot/dts/ti/k3-j721e-thermal.dtsi | 75 +++++++++++++++++++ arch/arm64/boot/dts/ti/k3-j721e.dtsi | 3 + 3 files changed, 87 insertions(+) create mode 100644 arch/arm64/boot/dts/ti/k3-j721e-thermal.dtsi diff --git a/arch/arm64/boot/dts/ti/k3-j721e-mcu-wakeup.dtsi b/arch/arm64/boot/dts/ti/k3-j721e-mcu-wakeup.dtsi index df08724bbf1c5..9a09f66c51c01 100644 --- a/arch/arm64/boot/dts/ti/k3-j721e-mcu-wakeup.dtsi +++ b/arch/arm64/boot/dts/ti/k3-j721e-mcu-wakeup.dtsi @@ -418,4 +418,13 @@ mcu_mcan1: can@40568000 { interrupt-names = "int0", "int1"; bosch,mram-cfg = <0x0 128 64 64 64 64 32 32>; }; + + vtm0: temperature-sensor@42040000 { + compatible = "ti,j721e-vtm"; + reg = <0x00 0x42040000 0x00 0x350>, + <0x00 0x42050000 0x00 0x350>, + <0x00 0x43000300 0x00 0x10>; + power-domains = <&k3_pds 154 TI_SCI_PD_EXCLUSIVE>; + #thermal-sensor-cells = <1>; + }; }; diff --git a/arch/arm64/boot/dts/ti/k3-j721e-thermal.dtsi b/arch/arm64/boot/dts/ti/k3-j721e-thermal.dtsi new file mode 100644 index 0000000000000..79641927a9092 --- /dev/null +++ b/arch/arm64/boot/dts/ti/k3-j721e-thermal.dtsi @@ -0,0 +1,75 @@ +// SPDX-License-Identifier: GPL-2.0 + +#include + +thermal_zones: thermal-zones { + wkup_thermal: wkup-thermal { + polling-delay-passive = <250>; /* milliSeconds */ + polling-delay = <500>; /* milliSeconds */ + thermal-sensors = <&vtm0 0>; + + trips { + wkup_crit: wkup-crit { + temperature = <125000>; /* milliCelsius */ + hysteresis = <2000>; /* milliCelsius */ + type = "critical"; + }; + }; + }; + + mpu_thermal: mpu-thermal { + polling-delay-passive = <250>; /* milliSeconds */ + polling-delay = <500>; /* milliSeconds */ + thermal-sensors = <&vtm0 1>; + + trips { + mpu_crit: mpu-crit { + temperature = <125000>; /* milliCelsius */ + hysteresis = <2000>; /* milliCelsius */ + type = "critical"; + }; + }; + }; + + c7x_thermal: c7x-thermal { + polling-delay-passive = <250>; /* milliSeconds */ + polling-delay = <500>; /* milliSeconds */ + thermal-sensors = <&vtm0 2>; + + trips { + c7x_crit: c7x-crit { + temperature = <125000>; /* milliCelsius */ + hysteresis = <2000>; /* milliCelsius */ + type = "critical"; + }; + }; + }; + + gpu_thermal: gpu-thermal { + polling-delay-passive = <250>; /* milliSeconds */ + polling-delay = <500>; /* milliSeconds */ + thermal-sensors = <&vtm0 3>; + + trips { + gpu_crit: gpu-crit { + temperature = <125000>; /* milliCelsius */ + hysteresis = <2000>; /* milliCelsius */ + type = "critical"; + }; + }; + }; + + r5f_thermal: r5f-thermal { + polling-delay-passive = <250>; /* milliSeconds */ + polling-delay = <500>; /* milliSeconds */ + thermal-sensors = <&vtm0 4>; + + trips { + r5f_crit: r5f-crit { + temperature = <125000>; /* milliCelsius */ + hysteresis = <2000>; /* milliCelsius */ + type = "critical"; + }; + }; + }; +}; diff --git a/arch/arm64/boot/dts/ti/k3-j721e.dtsi b/arch/arm64/boot/dts/ti/k3-j721e.dtsi index 0e23886c9fd1d..cfab10e2455c4 100644 --- a/arch/arm64/boot/dts/ti/k3-j721e.dtsi +++ b/arch/arm64/boot/dts/ti/k3-j721e.dtsi @@ -181,6 +181,9 @@ cbass_mcu_wakeup: bus@28380000 { <0x07 0x00000000 0x07 0x00000000 0x01 0x00000000>; /* FSS OSPI1 data region 3*/ }; }; + + #include "k3-j721e-thermal.dtsi" + }; /* Now include the peripherals for each bus segments */ From patchwork Tue Oct 11 23:17:26 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Bryan Brattlof X-Patchwork-Id: 13004518 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 660B6C433FE for ; Tue, 11 Oct 2022 23:21:08 +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:References:In-Reply-To: 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: List-Owner; bh=GhqtEQ7Vkl8K7P8D+Q6Kb1YbHKb7y+mishS8Ma1m2zg=; b=E7gp7Y98yOD+Hh sqN+HfyvV7GBWwmRkxDHrOY1eAB+lHVGwuVz6hofcDJFD+HR+aHl93EpuV5kNCrWB8lKhxjbu1RK1 wZPnMALTq5gg8PmMTVjb4xKa6FnS2HxDXlmdYRtC5c+CfSMKnXG0e9MVnZW6JsuRWmeTNxrEJJj9C vHY9wHWv7wf6LukI/2H1NdE+47y2e5g1X6H5w4DaDNsweYA6jTz/7U8a8+F4kc2x1pATNvd+eniYO h5P8bN7GW5cGP89tpENqhJZPRusfiVnvLLG44/53m1NrFED2EzJB2hqtJ0l61lUoudXApONRpcAxo Us62KEDhwzCylpsyvV4g==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1oiOXa-0069ig-1d; Tue, 11 Oct 2022 23:20:02 +0000 Received: from fllv0016.ext.ti.com ([198.47.19.142]) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1oiOVt-0068zW-JM for linux-arm-kernel@lists.infradead.org; Tue, 11 Oct 2022 23:18:19 +0000 Received: from fllv0034.itg.ti.com ([10.64.40.246]) by fllv0016.ext.ti.com (8.15.2/8.15.2) with ESMTP id 29BNI7gw087602; Tue, 11 Oct 2022 18:18:07 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ti.com; s=ti-com-17Q1; t=1665530287; bh=ifPTetxL+42FtzkGJpKl3HOJsxdbDcsQt1OE8BdlIv0=; h=From:To:CC:Subject:Date:In-Reply-To:References; b=HeJqJdMDrT60ESYHHmdB6ZS8clQ+XEsGIhcxvFa0rPW3bqhZCdnQ/GhytYJwgmjBg PzvunoibHkhnb8LrQudmcztx8zZPzQqmkwB2MjQIW/xsHttgL839UWbDngq6gRTyb4 vQRub+d2MvxAuBOpHG2OIUxH0Sg6YOhmIBaYNZI8= Received: from DFLE114.ent.ti.com (dfle114.ent.ti.com [10.64.6.35]) by fllv0034.itg.ti.com (8.15.2/8.15.2) with ESMTPS id 29BNI7TM130219 (version=TLSv1.2 cipher=AES256-GCM-SHA384 bits=256 verify=FAIL); Tue, 11 Oct 2022 18:18:07 -0500 Received: from DFLE113.ent.ti.com (10.64.6.34) by DFLE114.ent.ti.com (10.64.6.35) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256_P256) id 15.1.2507.6; Tue, 11 Oct 2022 18:18:06 -0500 Received: from fllv0040.itg.ti.com (10.64.41.20) by DFLE113.ent.ti.com (10.64.6.34) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256_P256) id 15.1.2507.6 via Frontend Transport; Tue, 11 Oct 2022 18:18:06 -0500 Received: from localhost (ileaxei01-snat.itg.ti.com [10.180.69.5]) by fllv0040.itg.ti.com (8.15.2/8.15.2) with ESMTP id 29BNI6Ap088553; Tue, 11 Oct 2022 18:18:06 -0500 From: Bryan Brattlof To: Rob Herring , Krzysztof Kozlowski CC: "Rafael J. Wysocki" , Daniel Lezcano , Amit Kucheria , Zhang Rui , Nishanth Menon , Vignesh Raghavendra , Tero Kristo , Keerthy , Linux Thermal , Linux Device Tree , LKML , Linux ARM , Bryan Brattlof Subject: [PATCH 10/11] arm64: dts: ti: k3-j721s2-mcu-wakeup: add VTM node Date: Tue, 11 Oct 2022 18:17:26 -0500 Message-ID: <20221011231727.8090-11-bb@ti.com> X-Mailer: git-send-email 2.38.0 In-Reply-To: <20221011231727.8090-1-bb@ti.com> References: <20221011231727.8090-1-bb@ti.com> MIME-Version: 1.0 X-Developer-Signature: v=1; a=openpgp-sha256; l=4419; h=from:subject; bh=olB1dowVR4Q+8T9smVkWKRdaLIkZJxl0ga3x4QT4VF0=; b=owNCWmg5MUFZJlNZALUuVgAAa////v9/1je+2q/+NqnfvFtTv/0v7m7e/uez/67bqxn8l34wARsy himgaB6jT1AAGgAAaBoGgANPUAAAADTIDQGgBo0002kPUAaGgZNHlPxUQaGhoGgeo0BiDJ6hoekyYh oGgDTIAGIYgNPSNPUyD0EGIaAaADRo0MmjR6RoHJo0GajQyaNNAZDJoxBoaANBiZDCANGmgAAyDJkD EyaBpkwmgBk0wTEaMkCYXMDuzgAEpnbQ2TmZcT3FRwVGHOeOjPhAL4ZJAqMp6g1OzK0SRaLxRLoGir Z0Uye6pGrPiwsqqN6mTtXr4iv7NWb360Pc4wD6wka9ejG22GcTokwRS3ig+SvGmBJKHeujbtmz8udC 9gCa0EBAX1WIyhAxTnEG4tC5Ey2PP/mJSbxXuQ0FYQy0kC0zFmPMIzNFOvLg6IhHvBNQq0vH7qqVau JUcqTmc+sG2nMeDK0XlUE+hBvyIZYenxa+ax2GC6IVLxMnsi/RTLIlAhV3pWrIgUPVAVrVnn4MCvUD NilnpsfFYRo2V2jLQQJT8EWe3Tmq2NnY/riwG73hMKIBT4JJ0cTuQiGyDIPOu7Wspd2/7rUeXcCYBS kPjrW0XtqNRDnKbcKYY8gTBNMyz7QANwRyItmcH++BDhGiqQT9XiL/xdyRThQkAC1LlYA= X-Developer-Key: i=bb@ti.com; a=openpgp; fpr=D3D177E40A38DF4D1853FEEF41B90D5D71D56CE0 X-EXCLAIMER-MD-CONFIG: e1e8a2fd-e40a-4ac6-ac9b-f7e9cc9ee180 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20221011_161817_819334_95576A4A X-CRM114-Status: GOOD ( 14.19 ) 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 The j721s2 supports a single Voltage and Thermal Management (VTM) device located in the wakeup domain with seven associated temperature monitors located in various hot spots on the die. Signed-off-by: Bryan Brattlof --- .../boot/dts/ti/k3-j721s2-mcu-wakeup.dtsi | 8 ++ arch/arm64/boot/dts/ti/k3-j721s2-thermal.dtsi | 103 ++++++++++++++++++ arch/arm64/boot/dts/ti/k3-j721s2.dtsi | 3 + 3 files changed, 114 insertions(+) create mode 100644 arch/arm64/boot/dts/ti/k3-j721s2-thermal.dtsi diff --git a/arch/arm64/boot/dts/ti/k3-j721s2-mcu-wakeup.dtsi b/arch/arm64/boot/dts/ti/k3-j721s2-mcu-wakeup.dtsi index 4d1bfabd1313a..8287fd32c42f3 100644 --- a/arch/arm64/boot/dts/ti/k3-j721s2-mcu-wakeup.dtsi +++ b/arch/arm64/boot/dts/ti/k3-j721s2-mcu-wakeup.dtsi @@ -299,4 +299,12 @@ cpts@3d000 { ti,cpts-periodic-outputs = <2>; }; }; + + vtm0: temperature-sensor@42040000 { + compatible = "ti,j7200-vtm"; + reg = <0x0 0x42040000 0x0 0x350>, + <0x0 0x42050000 0x0 0x350>; + power-domains = <&k3_pds 154 TI_SCI_PD_SHARED>; + #thermal-sensor-cells = <1>; + }; }; diff --git a/arch/arm64/boot/dts/ti/k3-j721s2-thermal.dtsi b/arch/arm64/boot/dts/ti/k3-j721s2-thermal.dtsi new file mode 100644 index 0000000000000..c51009536756e --- /dev/null +++ b/arch/arm64/boot/dts/ti/k3-j721s2-thermal.dtsi @@ -0,0 +1,103 @@ +// SPDX-License-Identifier: GPL-2.0 + +#include + +thermal_zones: thermal-zones { + wkup0_thermal: wkup0-thermal { + polling-delay-passive = <250>; /* milliSeconds */ + polling-delay = <500>; /* milliSeconds */ + thermal-sensors = <&vtm0 0>; + + trips { + wkup0_crit: wkup0-crit { + temperature = <125000>; /* milliCelsius */ + hysteresis = <2000>; /* milliCelsius */ + type = "critical"; + }; + }; + }; + + wkup1_thermal: wkup1-thermal { + polling-delay-passive = <250>; /* milliSeconds */ + polling-delay = <500>; /* milliSeconds */ + thermal-sensors = <&vtm0 1>; + + trips { + wkup1_crit: wkup1-crit { + temperature = <125000>; /* milliCelsius */ + hysteresis = <2000>; /* milliCelsius */ + type = "critical"; + }; + }; + }; + + main0_thermal: main0-thermal { + polling-delay-passive = <250>; /* milliSeconds */ + polling-delay = <500>; /* milliSeconds */ + thermal-sensors = <&vtm0 2>; + + trips { + main0_crit: main0-crit { + temperature = <125000>; /* milliCelsius */ + hysteresis = <2000>; /* milliCelsius */ + type = "critical"; + }; + }; + }; + + main1_thermal: main1-thermal { + polling-delay-passive = <250>; /* milliSeconds */ + polling-delay = <500>; /* milliSeconds */ + thermal-sensors = <&vtm0 3>; + + trips { + main1_crit: main1-crit { + temperature = <125000>; /* milliCelsius */ + hysteresis = <2000>; /* milliCelsius */ + type = "critical"; + }; + }; + }; + + main2_thermal: main2-thermal { + polling-delay-passive = <250>; /* milliSeconds */ + polling-delay = <500>; /* milliSeconds */ + thermal-sensors = <&vtm0 4>; + + trips { + main2_crit: main2-crit { + temperature = <125000>; /* milliCelsius */ + hysteresis = <2000>; /* milliCelsius */ + type = "critical"; + }; + }; + }; + + main3_thermal: main3-thermal { + polling-delay-passive = <250>; /* milliSeconds */ + polling-delay = <500>; /* milliSeconds */ + thermal-sensors = <&vtm0 5>; + + trips { + main3_crit: main3-crit { + temperature = <125000>; /* milliCelsius */ + hysteresis = <2000>; /* milliCelsius */ + type = "critical"; + }; + }; + }; + + main4_thermal: main4-thermal { + polling-delay-passive = <250>; /* milliSeconds */ + polling-delay = <500>; /* milliSeconds */ + thermal-sensors = <&vtm0 6>; + + trips { + main4_crit: main4-crit { + temperature = <125000>; /* milliCelsius */ + hysteresis = <2000>; /* milliCelsius */ + type = "critical"; + }; + }; + }; +}; diff --git a/arch/arm64/boot/dts/ti/k3-j721s2.dtsi b/arch/arm64/boot/dts/ti/k3-j721s2.dtsi index 7b930a85a29d6..33ea52e28b24f 100644 --- a/arch/arm64/boot/dts/ti/k3-j721s2.dtsi +++ b/arch/arm64/boot/dts/ti/k3-j721s2.dtsi @@ -161,6 +161,9 @@ cbass_mcu_wakeup: bus@28380000 { }; }; + + #include "k3-j721s2-thermal.dtsi" + }; /* Now include peripherals from each bus segment */ From patchwork Tue Oct 11 23:17:27 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Bryan Brattlof X-Patchwork-Id: 13004519 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 F149AC4332F for ; Tue, 11 Oct 2022 23:21:34 +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:References:In-Reply-To: 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: List-Owner; bh=GVKw23mpLta5n3Lelscafxx4vwbajb+QtEIlkGpPAfA=; b=d2DF2PDbIF9LBj GfOvjNZpl9yW0TH8DnF9zkmmaDElz8/Mb7wzUDv9XsWuXgJt9ta9Ow6QjqA3E8cMz9qfHQCzcE7Pi TmJnhxOGwvNkPwlJCf+PSUaiEr71e4it9KkFk7Jzhe+kTvvLI2XQYP5YC8TRpIsGFOMg8KgcShsOR rG0+3PGpeQUx/dIu/VlC8hqiJAXG85LVefIKw7qdAjFfSHSB5wKMH+dSQvDrxQ2w1B6LOsyVrvAgL GEQo4xoRrFj2NgJmmkb0fptPRhiAeOrXCZW6ovnFyplpFiigy2Ro4T7aWlt3H26ME75mNRSoXifhU 3BFJMuK3cJLZm6yCeaaw==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1oiOXy-0069uu-NA; Tue, 11 Oct 2022 23:20:27 +0000 Received: from fllv0015.ext.ti.com ([198.47.19.141]) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1oiOW0-006925-AH for linux-arm-kernel@lists.infradead.org; Tue, 11 Oct 2022 23:18:26 +0000 Received: from lelv0266.itg.ti.com ([10.180.67.225]) by fllv0015.ext.ti.com (8.15.2/8.15.2) with ESMTP id 29BNI8dd005708; Tue, 11 Oct 2022 18:18:08 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ti.com; s=ti-com-17Q1; t=1665530288; bh=yWGhxBED/EYOztiXTHh4AcivwZfhpPNPRo8BTRUenMk=; h=From:To:CC:Subject:Date:In-Reply-To:References; b=eAV+C1po8q3Q4Qjyof97fUv5itM+sghueiDX1vmdP0JbWOP2XG1w48AK4nNVLPpyc RVQpwQ/Rr+q7GInghakfu3FLSGKZty8DnNlEXQdy6XmuaibLiZ+rynxB62JLVqc92g tZiVa/qlTzYXFB15C/Ogg69gaJIcuY9JzpnvJq6k= Received: from DLEE113.ent.ti.com (dlee113.ent.ti.com [157.170.170.24]) by lelv0266.itg.ti.com (8.15.2/8.15.2) with ESMTPS id 29BNI8Lb081780 (version=TLSv1.2 cipher=AES256-GCM-SHA384 bits=256 verify=FAIL); Tue, 11 Oct 2022 18:18:08 -0500 Received: from DLEE114.ent.ti.com (157.170.170.25) by DLEE113.ent.ti.com (157.170.170.24) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256_P256) id 15.1.2507.6; Tue, 11 Oct 2022 18:18:07 -0500 Received: from fllv0040.itg.ti.com (10.64.41.20) by DLEE114.ent.ti.com (157.170.170.25) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256_P256) id 15.1.2507.6 via Frontend Transport; Tue, 11 Oct 2022 18:18:07 -0500 Received: from localhost (ileaxei01-snat.itg.ti.com [10.180.69.5]) by fllv0040.itg.ti.com (8.15.2/8.15.2) with ESMTP id 29BNI7nG088568; Tue, 11 Oct 2022 18:18:07 -0500 From: Bryan Brattlof To: Rob Herring , Krzysztof Kozlowski CC: "Rafael J. Wysocki" , Daniel Lezcano , Amit Kucheria , Zhang Rui , Nishanth Menon , Vignesh Raghavendra , Tero Kristo , Keerthy , Linux Thermal , Linux Device Tree , LKML , Linux ARM , Bryan Brattlof Subject: [PATCH 11/11] arm64: dts: ti: k3-j7200-mcu-wakeup: add VTM node Date: Tue, 11 Oct 2022 18:17:27 -0500 Message-ID: <20221011231727.8090-12-bb@ti.com> X-Mailer: git-send-email 2.38.0 In-Reply-To: <20221011231727.8090-1-bb@ti.com> References: <20221011231727.8090-1-bb@ti.com> MIME-Version: 1.0 X-Developer-Signature: v=1; a=openpgp-sha256; l=3059; h=from:subject; bh=1sRLapOsPYA037+Zk0rINvpjpnn0VqHMNprDoz4GFMU=; b=owNCWmg5MUFZJlNZRQKgwwAAZ/////9v4/v13F//15LL/8eP323/ZW67zt/7bb/cx5b+7u+wARsY kPKDQBoAAbUAAaBoDIANMgAAAAADRoABoeoA0aNHqaBkD00Rp6gNP1MkMoDQD1ABoA0D1ABoNBoDQA DT1GjQDQAeoAaGQAG0mjR6hkbUGR5QeoNDJ6gNDk09Roeoek0GmmhiBoGjJoYho0NABoDIaANNNAZN DQGhiGmgaNADQaYQDRkDI0AAEQNW9I3kIC6B6Rc6UORz6unmX299wUKLDa+izDWTwnpQiEoMTwIfs5 JgoikEkFEPOStCessk1KIejx00vbGnl3oZIOKn2sTod90PNQgJyXXm+C9tyw+UaYJ6lCi0GFYn+I0K AkAJGg7bWHEYD6SZcCVwlGCiNwwyvlIqPFJVrwUiPCRBhpfUtSgYkPCZFnma3+wQhjKBOJeSwRZGdv ZuVyHvxZ8rW3jpe9Z+gVRs6OqN4i5UBbfKrxAKAYxZp39MSo2UCcbztErydU4I6RXl2HYMdYEHAo39 SmhA1AHzNOEJjZS4rUmkRJDqiHVpF49ssUuJ8UwhnNziEWkmVgDdUf+4Hy6QFU6PRXhEtwYVLUs0jE If5UwSBPRS+bFxDPxTS5aO6lhAy7U0Xhp2BQBy2LP9V0UExAwD7GjVsmHn/i7kinChIIoFQYY= X-Developer-Key: i=bb@ti.com; a=openpgp; fpr=D3D177E40A38DF4D1853FEEF41B90D5D71D56CE0 X-EXCLAIMER-MD-CONFIG: e1e8a2fd-e40a-4ac6-ac9b-f7e9cc9ee180 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20221011_161824_498753_E7E62390 X-CRM114-Status: GOOD ( 14.30 ) 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 The j7200 supports a single Voltage and Thermal Management (VTM) device located in the wakeup domain with three associated temperature monitors located in various hot spots on the die. Signed-off-by: Bryan Brattlof --- .../boot/dts/ti/k3-j7200-mcu-wakeup.dtsi | 8 ++++ arch/arm64/boot/dts/ti/k3-j7200-thermal.dtsi | 47 +++++++++++++++++++ arch/arm64/boot/dts/ti/k3-j7200.dtsi | 3 ++ 3 files changed, 58 insertions(+) create mode 100644 arch/arm64/boot/dts/ti/k3-j7200-thermal.dtsi diff --git a/arch/arm64/boot/dts/ti/k3-j7200-mcu-wakeup.dtsi b/arch/arm64/boot/dts/ti/k3-j7200-mcu-wakeup.dtsi index ff13bbeed30c9..34d3e9bbd181c 100644 --- a/arch/arm64/boot/dts/ti/k3-j7200-mcu-wakeup.dtsi +++ b/arch/arm64/boot/dts/ti/k3-j7200-mcu-wakeup.dtsi @@ -375,4 +375,12 @@ mcu_r5fss0_core1: r5f@41400000 { ti,loczrama = <1>; }; }; + + vtm0: temperature-sensor@42040000 { + compatible = "ti,j7200-vtm"; + reg = <0x00 0x42040000 0x00 0x350>, + <0x00 0x42050000 0x00 0x350>; + power-domains = <&k3_pds 154 TI_SCI_PD_EXCLUSIVE>; + #thermal-sensor-cells = <1>; + }; }; diff --git a/arch/arm64/boot/dts/ti/k3-j7200-thermal.dtsi b/arch/arm64/boot/dts/ti/k3-j7200-thermal.dtsi new file mode 100644 index 0000000000000..0bf52c93c3f9a --- /dev/null +++ b/arch/arm64/boot/dts/ti/k3-j7200-thermal.dtsi @@ -0,0 +1,47 @@ +// SPDX-License-Identifier: GPL-2.0 + +#include + +thermal_zones: thermal-zones { + mcu_thermal: mcu-thermal { + polling-delay-passive = <250>; /* milliSeconds */ + polling-delay = <500>; /* milliSeconds */ + thermal-sensors = <&vtm0 0>; + + trips { + wkup_crit: wkup-crit { + temperature = <125000>; /* milliCelsius */ + hysteresis = <2000>; /* milliCelsius */ + type = "critical"; + }; + }; + }; + + mpu_thermal: mpu-thermal { + polling-delay-passive = <250>; /* milliSeconds */ + polling-delay = <500>; /* milliSeconds */ + thermal-sensors = <&vtm0 1>; + + trips { + mpu_crit: mpu-crit { + temperature = <125000>; /* milliCelsius */ + hysteresis = <2000>; /* milliCelsius */ + type = "critical"; + }; + }; + }; + + main_thermal: main-thermal { + polling-delay-passive = <250>; /* milliSeconds */ + polling-delay = <500>; /* milliSeconds */ + thermal-sensors = <&vtm0 2>; + + trips { + c7x_crit: c7x-crit { + temperature = <125000>; /* milliCelsius */ + hysteresis = <2000>; /* milliCelsius */ + type = "critical"; + }; + }; + }; +}; diff --git a/arch/arm64/boot/dts/ti/k3-j7200.dtsi b/arch/arm64/boot/dts/ti/k3-j7200.dtsi index b6da0454cc5bd..9368a6e3d4a62 100644 --- a/arch/arm64/boot/dts/ti/k3-j7200.dtsi +++ b/arch/arm64/boot/dts/ti/k3-j7200.dtsi @@ -168,6 +168,9 @@ cbass_mcu_wakeup: bus@28380000 { <0x07 0x00000000 0x07 0x00000000 0x01 0x00000000>; /* FSS OSPI1 data region 3 */ }; }; + + #include "k3-j7200-thermal.dtsi" + }; /* Now include the peripherals for each bus segments */