From nobody Sat Sep 21 02:35:46 2024 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 vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 81164C6FD1E for ; Tue, 7 Mar 2023 15:45:41 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231408AbjCGPpj (ORCPT ); Tue, 7 Mar 2023 10:45:39 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:53726 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230468AbjCGPpc (ORCPT ); Tue, 7 Mar 2023 10:45:32 -0500 Received: from mail-wr1-x42c.google.com (mail-wr1-x42c.google.com [IPv6:2a00:1450:4864:20::42c]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id E443E4ECC2 for ; Tue, 7 Mar 2023 07:45:29 -0800 (PST) Received: by mail-wr1-x42c.google.com with SMTP id r18so12595299wrx.1 for ; Tue, 07 Mar 2023 07:45:29 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=baylibre-com.20210112.gappssmtp.com; s=20210112; t=1678203928; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=+OFCWs6sMvmcACVP359vGdpDLS8nF6pX77Um/B5ZzBQ=; b=I4Km7KvrsZJjag+t2OnVfY3qj3nEqw18rDA/g/UnXtDjeMVyd4k+jsQmwXhiEHzOOo kus9JATGqXhXUaxRpv72NOs1h97nszn7FihQqNJoWCZ4lJ2nBUxLH8V90eL0TPDQu0QI QnkjKYyyNt80BDehpoieSDTVidG4vOfOz8QARoAuzl0FpUgYUQFqaeYZtm8H+1GNymNh e/F9JasTMspKNjy0jKFrRUHz1uU3XzRE/rshBmRHo6TedQ2ljZi4b5ko1viqH4ExiODT mezb4sGJN4y4TEdKqBJ9b97gThmeClR1kvXXs5KWMhrroBsc9N/cws97ENwz8+QX6NQ7 CQ3g== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; t=1678203928; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=+OFCWs6sMvmcACVP359vGdpDLS8nF6pX77Um/B5ZzBQ=; b=3jtb7oA2rAyM/rjEDBpDgnqEml5Q481v8tfdJCA9YKCr8ZXx2osOxuKvK7Xd3r0nzt UlTCdByui4MqT1aWuHETt0U1pcn94N+fiMaPWDOdWTjFXSqlpjICQTa5J4vkIakFYtiF EQ9rkbT+KvVV5LOhBMSOe30ZpYENo5C970L2CLabMsBL7CH03IdmUhTKb4NJXJ/Dvp7D 9Xgj1evzNnEXiLE7/GCe0JAQgbR0kfDvbcupoSUgExv984oX2lhaoRWh2tYJpwZ+OIa3 VYOxyK+HOk5cYCK3/zfAi4NbktKQ8w9LgA76rl08kRdj56Tt1eZ/PHqXK5HezQ1F7Ea4 5fuA== X-Gm-Message-State: AO0yUKUKz1PQwljy/OerA6Vbs3XJmW8kHAMNVaomqINSyPW6jrvP85dy 7MDjLJvU1BSQmovAdP52Y1zMIQ== X-Google-Smtp-Source: AK7set/+bC2C/uYd0izZbbAPg4Ofkw0p/GsTZYFxd0TjK9UR7bUQOp5p/RMcGAtJ3iaLQsWPqZ5+hw== X-Received: by 2002:a5d:4089:0:b0:2c7:3ee7:a44c with SMTP id o9-20020a5d4089000000b002c73ee7a44cmr8371471wrp.65.1678203928444; Tue, 07 Mar 2023 07:45:28 -0800 (PST) Received: from localhost.localdomain (laubervilliers-657-1-248-155.w90-24.abo.wanadoo.fr. [90.24.137.155]) by smtp.gmail.com with ESMTPSA id f2-20020a5d50c2000000b002c704271b05sm12697905wrt.66.2023.03.07.07.45.27 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 07 Mar 2023 07:45:28 -0800 (PST) From: bchihi@baylibre.com To: daniel.lezcano@linaro.org, angelogioacchino.delregno@collabora.com, rafael@kernel.org, amitk@kernel.org, rui.zhang@intel.com, matthias.bgg@gmail.com, robh+dt@kernel.org, krzysztof.kozlowski+dt@linaro.org, rdunlap@infradead.org, ye.xingchen@zte.com.cn, p.zabel@pengutronix.de Cc: linux-pm@vger.kernel.org, linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-mediatek@lists.infradead.org, devicetree@vger.kernel.org, khilman@baylibre.com, james.lo@mediatek.com, rex-bc.chen@mediatek.com Subject: [PATCH 1/4] dt-bindings: thermal: mediatek: Add AP domain to LVTS thermal controllers for mt8195 Date: Tue, 7 Mar 2023 16:45:21 +0100 Message-Id: <20230307154524.118541-2-bchihi@baylibre.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20230307154524.118541-1-bchihi@baylibre.com> References: <20230307154524.118541-1-bchihi@baylibre.com> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Type: text/plain; charset="utf-8" From: Balsam CHIHI Add AP Domain to LVTS thermal controllers dt-binding definition for mt8195. Signed-off-by: Balsam CHIHI Acked-by: Rob Herring Reviewed-by: AngeloGioacchino Del Regno Tested-by: Chen-Yu Tsai --- include/dt-bindings/thermal/mediatek,lvts-thermal.h | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/include/dt-bindings/thermal/mediatek,lvts-thermal.h b/include/= dt-bindings/thermal/mediatek,lvts-thermal.h index c09398920468..8fa5a46675c4 100644 --- a/include/dt-bindings/thermal/mediatek,lvts-thermal.h +++ b/include/dt-bindings/thermal/mediatek,lvts-thermal.h @@ -16,4 +16,14 @@ #define MT8195_MCU_LITTLE_CPU2 6 #define MT8195_MCU_LITTLE_CPU3 7 =20 +#define MT8195_AP_VPU0 8 +#define MT8195_AP_VPU1 9 +#define MT8195_AP_GPU0 10 +#define MT8195_AP_GPU1 11 +#define MT8195_AP_VDEC 12 +#define MT8195_AP_IMG 13 +#define MT8195_AP_INFRA 14 +#define MT8195_AP_CAM0 15 +#define MT8195_AP_CAM1 16 + #endif /* __MEDIATEK_LVTS_DT_H */ --=20 2.34.1 From nobody Sat Sep 21 02:35:46 2024 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 vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id A90AEC678D4 for ; Tue, 7 Mar 2023 15:45:46 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230431AbjCGPpo (ORCPT ); Tue, 7 Mar 2023 10:45:44 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:53796 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231234AbjCGPpd (ORCPT ); Tue, 7 Mar 2023 10:45:33 -0500 Received: from mail-wr1-x42a.google.com (mail-wr1-x42a.google.com [IPv6:2a00:1450:4864:20::42a]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 94EA8838B8 for ; Tue, 7 Mar 2023 07:45:30 -0800 (PST) Received: by mail-wr1-x42a.google.com with SMTP id bx12so12554544wrb.11 for ; Tue, 07 Mar 2023 07:45:30 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=baylibre-com.20210112.gappssmtp.com; s=20210112; t=1678203929; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=mDUOEs+XSiOfyiNiOvW3qp6/s0S8NXRmgJF421g68As=; b=T2+UqBQ/B0o7lX4P+fFNGS8AxIhdRQnYL4u4eNa7vRwBpDax96IfUm5+btsWfAbHcK Sdr3j0hYKmTAbAHYv/qL/mPpQQJJPqyKnKMepnHYk3PdPsyrRt5pQVsB4wYuygFJ7jg5 H0Ic8Yt+QpJOslls+C9511LK9mHgITHGmgRC6e4n2N8NOVMCiP2ueRTdPubfescwcybS 61uLpz+0u8U9qoUSjalcknogymte+g8ZLweUlmmH0L/cH0M4DaN7UOYZVZZ7MHUOBmzM L97fKVMk6hNpf4IT17R9VddhXt8Rr0OKI/efvPyffo6FYMDI7YjO9u0YsRXDmxX0e8TL uXfw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; t=1678203929; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=mDUOEs+XSiOfyiNiOvW3qp6/s0S8NXRmgJF421g68As=; b=0JsRYaf+pBc8PPEvlB2AX0zq6TlG6s5sTDpCHPo5a+YyBZddHd8SX04x/Kk+v2Rz3r 0x501U6SOyS4qGIHHJpPtb81vE4IB/G+QICze3lGAYNFyHzggedMFNDu9mj+ja2Xmlti K2gGphz9ISB8rk04rCmo8DkJYoprbNImSQQemahHypUQlsANp90kuSgtRDQEQPiXcfmS WWjbhmNaPbgXT8tWIpWmFdUdWxLH4GVkcHXlbqoREMPIQCjhJara+ZWgvHm/Yd0BG2E1 kH5thKXsEKiGgNTpdqMLMVH3OnCd4qOaQpSGZfqRDhcx6OSRFMQW39j6xGrJ5PzhhGsC ZBIg== X-Gm-Message-State: AO0yUKVID81R+Ibdj2Yyb3gTaSTGqh/7T6VNqpFteg2D67fruSvnlkrr 2vpJhZuWonhkB+AY1QT5uX6pKg== X-Google-Smtp-Source: AK7set+D4VvEr8Bpnmjt43C/gu6jiUPUyAHWRjw53NuTFxCehWbsdbW+MiO3KVlZBzRA8OdTuO/NLw== X-Received: by 2002:a5d:634d:0:b0:2c7:ae57:5acc with SMTP id b13-20020a5d634d000000b002c7ae575accmr9993378wrw.26.1678203929163; Tue, 07 Mar 2023 07:45:29 -0800 (PST) Received: from localhost.localdomain (laubervilliers-657-1-248-155.w90-24.abo.wanadoo.fr. [90.24.137.155]) by smtp.gmail.com with ESMTPSA id f2-20020a5d50c2000000b002c704271b05sm12697905wrt.66.2023.03.07.07.45.28 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 07 Mar 2023 07:45:29 -0800 (PST) From: bchihi@baylibre.com To: daniel.lezcano@linaro.org, angelogioacchino.delregno@collabora.com, rafael@kernel.org, amitk@kernel.org, rui.zhang@intel.com, matthias.bgg@gmail.com, robh+dt@kernel.org, krzysztof.kozlowski+dt@linaro.org, rdunlap@infradead.org, ye.xingchen@zte.com.cn, p.zabel@pengutronix.de Cc: linux-pm@vger.kernel.org, linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-mediatek@lists.infradead.org, devicetree@vger.kernel.org, khilman@baylibre.com, james.lo@mediatek.com, rex-bc.chen@mediatek.com Subject: [PATCH 2/4] thermal/drivers/mediatek/lvts_thermal: Add AP domain for mt8195 Date: Tue, 7 Mar 2023 16:45:22 +0100 Message-Id: <20230307154524.118541-3-bchihi@baylibre.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20230307154524.118541-1-bchihi@baylibre.com> References: <20230307154524.118541-1-bchihi@baylibre.com> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Type: text/plain; charset="utf-8" From: Balsam CHIHI Add MT8195 AP Domain support to LVTS Driver. Signed-off-by: Balsam CHIHI Tested-by: Chen-Yu Tsai --- drivers/thermal/mediatek/lvts_thermal.c | 94 +++++++++++++++++++------ 1 file changed, 74 insertions(+), 20 deletions(-) diff --git a/drivers/thermal/mediatek/lvts_thermal.c b/drivers/thermal/medi= atek/lvts_thermal.c index 5dbc80ba961b..7565def6b27c 100644 --- a/drivers/thermal/mediatek/lvts_thermal.c +++ b/drivers/thermal/mediatek/lvts_thermal.c @@ -528,29 +528,33 @@ static int lvts_sensor_init(struct device *dev, struc= t lvts_ctrl *lvts_ctrl, * The efuse blob values follows the sensor enumeration per thermal * controller. The decoding of the stream is as follow: * - * <--?-> <----big0 ???---> <-sensor0-> <-0-> - * ------------------------------------------ - * index in the stream: : | 0x0 | 0x1 | 0x2 | 0x3 | 0x4 | 0x5 | 0x6 | - * ------------------------------------------ + * stream index map for MCU Domain : * - * <--sensor1--><-0-> <----big1 ???---> <-sen - * ------------------------------------------ - * | 0x7 | 0x8 | 0x9 | 0xA | 0xB | OxC | OxD | - * ------------------------------------------ + * <-----mcu-tc#0-----> <-----sensor#0-----> <-----sensor#1-----> + * 0x01 | 0x02 | 0x03 | 0x04 | 0x05 | 0x06 | 0x07 | 0x08 | 0x09 * - * sor0-> <-0-> <-sensor1-> <-0-> .......... - * ------------------------------------------ - * | 0x7 | 0x8 | 0x9 | 0xA | 0xB | OxC | OxD | - * ------------------------------------------ + * <-----mcu-tc#1-----> <-----sensor#2-----> <-----sensor#3-----> + * 0x0A | 0x0B | 0x0C | 0x0D | 0x0E | 0x0F | 0x10 | 0x11 | 0x12 * - * And so on ... + * <-----mcu-tc#2-----> <-----sensor#4-----> <-----sensor#5-----> <-----se= nsor#6-----> <-----sensor#7-----> + * 0x13 | 0x14 | 0x15 | 0x16 | 0x17 | 0x18 | 0x19 | 0x1A | 0x1B | 0x1C | = 0x1D | 0x1E | 0x1F | 0x20 | 0x21 + * + * stream index map for AP Domain : + * + * <-----ap--tc#0-----> <-----sensor#0-----> <-----sensor#1-----> + * 0x22 | 0x23 | 0x24 | 0x25 | 0x26 | 0x27 | 0x28 | 0x29 | 0x2A + * + * <-----ap--tc#1-----> <-----sensor#2-----> <-----sensor#3-----> + * 0x2B | 0x2C | 0x2D | 0x2E | 0x2F | 0x30 | 0x31 | 0x32 | 0x33 + * + * <-----ap--tc#2-----> <-----sensor#4-----> <-----sensor#5-----> <-----se= nsor#6-----> + * 0x34 | 0x35 | 0x36 | 0x37 | 0x38 | 0x39 | 0x3A | 0x3B | 0x3C | 0x3D | = 0x3E | 0x3F + * + * <-----ap--tc#3-----> <-----sensor#7-----> <-----sensor#8-----> + * 0x40 | 0x41 | 0x42 | 0x43 | 0x44 | 0x45 | 0x46 | 0x47 | 0x48 * * The data description gives the offset of the calibration data in * this bytes stream for each sensor. - * - * Each thermal controller can handle up to 4 sensors max, we don't - * care if there are less as the array of calibration is sized to 4 - * anyway. The unused sensor slot will be zeroed. */ static int lvts_calibration_init(struct device *dev, struct lvts_ctrl *lvt= s_ctrl, const struct lvts_ctrl_data *lvts_ctrl_data, @@ -1163,7 +1167,7 @@ static int lvts_remove(struct platform_device *pdev) return 0; } =20 -static const struct lvts_ctrl_data mt8195_lvts_data_ctrl[] =3D { +static const struct lvts_ctrl_data mt8195_lvts_mcu_data_ctrl[] =3D { { .cal_offset =3D { 0x04, 0x07 }, .lvts_sensor =3D { @@ -1198,13 +1202,63 @@ static const struct lvts_ctrl_data mt8195_lvts_data= _ctrl[] =3D { } }; =20 +static const struct lvts_ctrl_data mt8195_lvts_ap_data_ctrl[] =3D { + { + .cal_offset =3D { 0x25, 0x28 }, + .lvts_sensor =3D { + { .dt_id =3D MT8195_AP_VPU0 }, + { .dt_id =3D MT8195_AP_VPU1 } + }, + .num_lvts_sensor =3D 2, + .offset =3D 0x0, + .hw_tshut_temp =3D LVTS_HW_SHUTDOWN_MT8195, + }, + { + .cal_offset =3D { 0x2e, 0x31 }, + .lvts_sensor =3D { + { .dt_id =3D MT8195_AP_GPU0 }, + { .dt_id =3D MT8195_AP_GPU1 } + }, + .num_lvts_sensor =3D 2, + .offset =3D 0x100, + .hw_tshut_temp =3D LVTS_HW_SHUTDOWN_MT8195, + }, + { + .cal_offset =3D { 0x37, 0x3a, 0x3d }, + .lvts_sensor =3D { + { .dt_id =3D MT8195_AP_VDEC }, + { .dt_id =3D MT8195_AP_IMG }, + { .dt_id =3D MT8195_AP_INFRA }, + }, + .num_lvts_sensor =3D 3, + .offset =3D 0x200, + .hw_tshut_temp =3D LVTS_HW_SHUTDOWN_MT8195, + }, + { + .cal_offset =3D { 0x43, 0x46 }, + .lvts_sensor =3D { + { .dt_id =3D MT8195_AP_CAM0 }, + { .dt_id =3D MT8195_AP_CAM1 } + }, + .num_lvts_sensor =3D 2, + .offset =3D 0x300, + .hw_tshut_temp =3D LVTS_HW_SHUTDOWN_MT8195, + } +}; + static const struct lvts_data mt8195_lvts_mcu_data =3D { - .lvts_ctrl =3D mt8195_lvts_data_ctrl, - .num_lvts_ctrl =3D ARRAY_SIZE(mt8195_lvts_data_ctrl), + .lvts_ctrl =3D mt8195_lvts_mcu_data_ctrl, + .num_lvts_ctrl =3D ARRAY_SIZE(mt8195_lvts_mcu_data_ctrl), +}; + +static const struct lvts_data mt8195_lvts_ap_data =3D { + .lvts_ctrl =3D mt8195_lvts_ap_data_ctrl, + .num_lvts_ctrl =3D ARRAY_SIZE(mt8195_lvts_ap_data_ctrl), }; =20 static const struct of_device_id lvts_of_match[] =3D { { .compatible =3D "mediatek,mt8195-lvts-mcu", .data =3D &mt8195_lvts_mcu_= data }, + { .compatible =3D "mediatek,mt8195-lvts-ap", .data =3D &mt8195_lvts_ap_da= ta }, {}, }; MODULE_DEVICE_TABLE(of, lvts_of_match); --=20 2.34.1 From nobody Sat Sep 21 02:35:46 2024 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 vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id E3CCEC678D5 for ; Tue, 7 Mar 2023 15:45:48 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231316AbjCGPpr (ORCPT ); Tue, 7 Mar 2023 10:45:47 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:53828 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231274AbjCGPpd (ORCPT ); Tue, 7 Mar 2023 10:45:33 -0500 Received: from mail-wr1-x435.google.com (mail-wr1-x435.google.com [IPv6:2a00:1450:4864:20::435]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 6634C84F63 for ; Tue, 7 Mar 2023 07:45:31 -0800 (PST) Received: by mail-wr1-x435.google.com with SMTP id h14so12585976wru.4 for ; Tue, 07 Mar 2023 07:45:31 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=baylibre-com.20210112.gappssmtp.com; s=20210112; t=1678203930; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=TK38rfMZIYSCE09aA82gNal1pzr6tS/kIcgasbLVBmk=; b=3rRyCvaUzbr48hyBZ2CFsD0pYrm9ofuBZ9w+ixhFmH+Wi43j+31NC/s814q6QNIxTy HhHe5i0C48LNdFjlVsmS6Qi3HTGBBAOkw+atIdb+RrvET+vqUuPqOuy10ch/rbOBIJqq Gu8Q074hLUlXgXMc+9Jru5M/pXPg8DI4UHy0rYtxZIqMsTvRGHf2NF4iBLKfIxa6TeD9 Ytg6qE0d5W3AVCzQpeXahs23kDYVx7eDGgdSX5WI3HzCk4EFU8VUyhiqoAa0q2VbZF/C DVRY4k2cCL6PX/NelxjSBxLwWI6/M0ycf6DfFO850jb8z4Kef6mdyadtYQeW4oe/5Nes I+Lw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; t=1678203930; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=TK38rfMZIYSCE09aA82gNal1pzr6tS/kIcgasbLVBmk=; b=Jh9n+CiWdvc8y9RfJgGxJw4NFafPCF+hvQWlTQRZt5kiAPhf4Jf+4gY/+6l68Dijsr 49/4vBKDeAqXZlBG9Ta9VmHbRIwdKtt4Xhykxwjem4iXBC2FqH7YEmkBVK1UlDgpUJ5V HxtjHTcb3ktCSfHQw0s33L5uJyEF1QFeuF0O5X+Wb96sm72hsgt9hFwQIeGIdsaJJ49m xLW34LvI0V5uvi1092Dxbogd2EOe9+bOofZgfADGZWNLfcpFZABnF8LhDq8T8NllLL4W 1doNEqeiratiZGk9ch15jpocUssUjF4gUxSQA3+5swr0ZEoEKJqABgWFmz6yTSvC4SCK dY8A== X-Gm-Message-State: AO0yUKVaq24p3xAofq5J1amN8cych+KvTBF7whkAH+PY37gQ50yje90A KVww4ClE3XfmztI2FwwE8qu36g== X-Google-Smtp-Source: AK7set+Guq1ajs13XQHeh554Uq/SiB1NQLIWJev32JcaTps3DMHgTcd/r/3pFPm5VF8vMQ7O2omnWw== X-Received: by 2002:a5d:4005:0:b0:2c9:5179:41a5 with SMTP id n5-20020a5d4005000000b002c9517941a5mr9632960wrp.8.1678203929903; Tue, 07 Mar 2023 07:45:29 -0800 (PST) Received: from localhost.localdomain (laubervilliers-657-1-248-155.w90-24.abo.wanadoo.fr. [90.24.137.155]) by smtp.gmail.com with ESMTPSA id f2-20020a5d50c2000000b002c704271b05sm12697905wrt.66.2023.03.07.07.45.29 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 07 Mar 2023 07:45:29 -0800 (PST) From: bchihi@baylibre.com To: daniel.lezcano@linaro.org, angelogioacchino.delregno@collabora.com, rafael@kernel.org, amitk@kernel.org, rui.zhang@intel.com, matthias.bgg@gmail.com, robh+dt@kernel.org, krzysztof.kozlowski+dt@linaro.org, rdunlap@infradead.org, ye.xingchen@zte.com.cn, p.zabel@pengutronix.de Cc: linux-pm@vger.kernel.org, linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-mediatek@lists.infradead.org, devicetree@vger.kernel.org, khilman@baylibre.com, james.lo@mediatek.com, rex-bc.chen@mediatek.com Subject: [PATCH 3/4] arm64: dts: mediatek: mt8195: Add AP domain thermal zones Date: Tue, 7 Mar 2023 16:45:23 +0100 Message-Id: <20230307154524.118541-4-bchihi@baylibre.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20230307154524.118541-1-bchihi@baylibre.com> References: <20230307154524.118541-1-bchihi@baylibre.com> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Type: text/plain; charset="utf-8" From: Balsam CHIHI Add AP Domain thermal zones for the mt8195. Signed-off-by: Balsam CHIHI Tested-by: Chen-Yu Tsai --- arch/arm64/boot/dts/mediatek/mt8195.dtsi | 126 +++++++++++++++++++++++ 1 file changed, 126 insertions(+) diff --git a/arch/arm64/boot/dts/mediatek/mt8195.dtsi b/arch/arm64/boot/dts= /mediatek/mt8195.dtsi index 10c8fb0856bc..b066d1eab1dc 100644 --- a/arch/arm64/boot/dts/mediatek/mt8195.dtsi +++ b/arch/arm64/boot/dts/mediatek/mt8195.dtsi @@ -2652,5 +2652,131 @@ map0 { }; }; }; + + vpu0-thermal { + polling-delay =3D <0>; + polling-delay-passive =3D <0>; + thermal-sensors =3D <&lvts_ap MT8195_AP_VPU0>; + + trips { + vpu0_crit: trip-crit { + temperature =3D <100000>; + hysteresis =3D <2000>; + type =3D "critical"; + }; + }; + }; + + vpu1-thermal { + polling-delay =3D <0>; + polling-delay-passive =3D <0>; + thermal-sensors =3D <&lvts_ap MT8195_AP_VPU1>; + + trips { + vpu1_crit: trip-crit { + temperature =3D <100000>; + hysteresis =3D <2000>; + type =3D "critical"; + }; + }; + }; + + gpu0-thermal { + polling-delay =3D <0>; + polling-delay-passive =3D <0>; + thermal-sensors =3D <&lvts_ap MT8195_AP_GPU0>; + + trips { + gpu0_crit: trip-crit { + temperature =3D <100000>; + hysteresis =3D <2000>; + type =3D "critical"; + }; + }; + }; + + gpu1-thermal { + polling-delay =3D <0>; + polling-delay-passive =3D <0>; + thermal-sensors =3D <&lvts_ap MT8195_AP_GPU1>; + + trips { + gpu1_crit: trip-crit { + temperature =3D <100000>; + hysteresis =3D <2000>; + type =3D "critical"; + }; + }; + }; + + vdec-thermal { + polling-delay =3D <0>; + polling-delay-passive =3D <0>; + thermal-sensors =3D <&lvts_ap MT8195_AP_VDEC>; + + trips { + vdec_crit: trip-crit { + temperature =3D <100000>; + hysteresis =3D <2000>; + type =3D "critical"; + }; + }; + }; + + img-thermal { + polling-delay =3D <0>; + polling-delay-passive =3D <0>; + thermal-sensors =3D <&lvts_ap MT8195_AP_IMG>; + + trips { + img_crit: trip-crit { + temperature =3D <100000>; + hysteresis =3D <2000>; + type =3D "critical"; + }; + }; + }; + + infra-thermal { + polling-delay =3D <0>; + polling-delay-passive =3D <0>; + thermal-sensors =3D <&lvts_ap MT8195_AP_INFRA>; + + trips { + infra_crit: trip-crit { + temperature =3D <100000>; + hysteresis =3D <2000>; + type =3D "critical"; + }; + }; + }; + + cam0-thermal { + polling-delay =3D <0>; + polling-delay-passive =3D <0>; + thermal-sensors =3D <&lvts_ap MT8195_AP_CAM0>; + + trips { + cam0_crit: trip-crit { + temperature =3D <100000>; + hysteresis =3D <2000>; + type =3D "critical"; + }; + }; + }; + + cam1-thermal { + polling-delay =3D <0>; + polling-delay-passive =3D <0>; + thermal-sensors =3D <&lvts_ap MT8195_AP_CAM1>; + + trips { + cam1_crit: trip-crit { + temperature =3D <100000>; + hysteresis =3D <2000>; + type =3D "critical"; + }; + }; + }; }; }; --=20 2.34.1 From nobody Sat Sep 21 02:35:46 2024 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 vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 74CFDC678D5 for ; Tue, 7 Mar 2023 15:45:51 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231352AbjCGPpu (ORCPT ); Tue, 7 Mar 2023 10:45:50 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:53942 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231312AbjCGPph (ORCPT ); Tue, 7 Mar 2023 10:45:37 -0500 Received: from mail-wr1-x42c.google.com (mail-wr1-x42c.google.com [IPv6:2a00:1450:4864:20::42c]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 2935E85345 for ; Tue, 7 Mar 2023 07:45:32 -0800 (PST) Received: by mail-wr1-x42c.google.com with SMTP id j2so12560901wrh.9 for ; Tue, 07 Mar 2023 07:45:32 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=baylibre-com.20210112.gappssmtp.com; s=20210112; t=1678203930; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=JY0Ro4rQcxnhRsiPxJHCXtVEYXHerbDIXQMmbNIdWm4=; b=HPRCUxRSNyyA/oVsmJzaxnWi/aGeU+cplMFkWIaR2F7aOlur6xHyVOmHaPAKxhi6S5 6HE4UAsO2+d0XsL5fLTME2qD1b9iemXabrKBz99/HFrLWyXgqZ10sOYFVcFPsXlzy/AS qt417U9I2jHYrPuL5Wu4SH7jhN8rWtLitFhGDLuldeq4REKk8ZLMdIpSTJm9bOwakbQI bsD2NwGi2p+IwZVSEEGnUIqRmG3GS4QFXwJ5n7Mx+wZ+zK+dywTlSMSeZp+gLtCSjkZ6 JYg57EDiQZ3V7pMCmUA9qHRyOz+/J/8UADAxwLqYYLNvcg7sDXZnmTRvVIWvty46O2Yi E0Ow== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; t=1678203930; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=JY0Ro4rQcxnhRsiPxJHCXtVEYXHerbDIXQMmbNIdWm4=; b=FsWu4z28Tn1rLi3RWOxf+zOIe33NoFwM6oeoR+aQ37ArigS69F64uxvNLZdo0GEfAs ZVBd2X1PlY/GmyEEkWN3YFaJKcu2Uk5iSUJQVOu/2IrzRyYkY6ooj8kUfXCxffYXsPX/ Kmoxjx9v+Jvqqkz33dY9UZQD3oBKn8eZNciowEXB41zqhhHYb13E3r6jMNmWa8QrI5z6 qxGIfM7ZGveC6WVFGaI/y5xRNwx0wOnyBHm63kyJ+EFsfAw4UbrGSc+ZSO6GZNAxMBxu iSQz9OJRajQssYTd+rPsNqn2f9ckuEZ++e9KEQXWHadDo6imU6aWbc01DwiAq4q8N2/n vXXg== X-Gm-Message-State: AO0yUKWRnLh7v0C/HfUoWPbYKZ4RoG/7sEPfGkwuj9WRdL13wLs+dE7V rRQhRjtFSPS+VFG+tlg7M1ioFyh3zZeXptlXLCM= X-Google-Smtp-Source: AK7set8RZzUjacZh8k2s+HDG9BdJ+pG4VhUR6FtsQdsozL54tKbWq3T7WAAE627gMEVl78AJPnNVIw== X-Received: by 2002:a5d:6a48:0:b0:2c7:dec:77a7 with SMTP id t8-20020a5d6a48000000b002c70dec77a7mr8356572wrw.71.1678203930693; Tue, 07 Mar 2023 07:45:30 -0800 (PST) Received: from localhost.localdomain (laubervilliers-657-1-248-155.w90-24.abo.wanadoo.fr. [90.24.137.155]) by smtp.gmail.com with ESMTPSA id f2-20020a5d50c2000000b002c704271b05sm12697905wrt.66.2023.03.07.07.45.30 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 07 Mar 2023 07:45:30 -0800 (PST) From: bchihi@baylibre.com To: daniel.lezcano@linaro.org, angelogioacchino.delregno@collabora.com, rafael@kernel.org, amitk@kernel.org, rui.zhang@intel.com, matthias.bgg@gmail.com, robh+dt@kernel.org, krzysztof.kozlowski+dt@linaro.org, rdunlap@infradead.org, ye.xingchen@zte.com.cn, p.zabel@pengutronix.de Cc: linux-pm@vger.kernel.org, linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-mediatek@lists.infradead.org, devicetree@vger.kernel.org, khilman@baylibre.com, james.lo@mediatek.com, rex-bc.chen@mediatek.com Subject: [PATCH 4/4] arm64: dts: mediatek: mt8195: Add AP domain temperature thresholds Date: Tue, 7 Mar 2023 16:45:24 +0100 Message-Id: <20230307154524.118541-5-bchihi@baylibre.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20230307154524.118541-1-bchihi@baylibre.com> References: <20230307154524.118541-1-bchihi@baylibre.com> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Type: text/plain; charset="utf-8" From: Balsam CHIHI Specify the targeted temperature thresholds. Signed-off-by: Balsam CHIHI Tested-by: Chen-Yu Tsai --- arch/arm64/boot/dts/mediatek/mt8195.dtsi | 90 +++++++++++++++++++----- 1 file changed, 72 insertions(+), 18 deletions(-) diff --git a/arch/arm64/boot/dts/mediatek/mt8195.dtsi b/arch/arm64/boot/dts= /mediatek/mt8195.dtsi index b066d1eab1dc..0dab67d283a6 100644 --- a/arch/arm64/boot/dts/mediatek/mt8195.dtsi +++ b/arch/arm64/boot/dts/mediatek/mt8195.dtsi @@ -2654,11 +2654,17 @@ map0 { }; =20 vpu0-thermal { - polling-delay =3D <0>; - polling-delay-passive =3D <0>; + polling-delay =3D <1000>; + polling-delay-passive =3D <250>; thermal-sensors =3D <&lvts_ap MT8195_AP_VPU0>; =20 trips { + vpu0_alert: trip-alert { + temperature =3D <85000>; + hysteresis =3D <2000>; + type =3D "passive"; + }; + vpu0_crit: trip-crit { temperature =3D <100000>; hysteresis =3D <2000>; @@ -2668,11 +2674,17 @@ vpu0_crit: trip-crit { }; =20 vpu1-thermal { - polling-delay =3D <0>; - polling-delay-passive =3D <0>; + polling-delay =3D <1000>; + polling-delay-passive =3D <250>; thermal-sensors =3D <&lvts_ap MT8195_AP_VPU1>; =20 trips { + vpu1_alert: trip-alert { + temperature =3D <85000>; + hysteresis =3D <2000>; + type =3D "passive"; + }; + vpu1_crit: trip-crit { temperature =3D <100000>; hysteresis =3D <2000>; @@ -2682,11 +2694,17 @@ vpu1_crit: trip-crit { }; =20 gpu0-thermal { - polling-delay =3D <0>; - polling-delay-passive =3D <0>; + polling-delay =3D <1000>; + polling-delay-passive =3D <250>; thermal-sensors =3D <&lvts_ap MT8195_AP_GPU0>; =20 trips { + gpu0_alert: trip-alert { + temperature =3D <85000>; + hysteresis =3D <2000>; + type =3D "passive"; + }; + gpu0_crit: trip-crit { temperature =3D <100000>; hysteresis =3D <2000>; @@ -2696,11 +2714,17 @@ gpu0_crit: trip-crit { }; =20 gpu1-thermal { - polling-delay =3D <0>; - polling-delay-passive =3D <0>; + polling-delay =3D <1000>; + polling-delay-passive =3D <250>; thermal-sensors =3D <&lvts_ap MT8195_AP_GPU1>; =20 trips { + gpu1_alert: trip-alert { + temperature =3D <85000>; + hysteresis =3D <2000>; + type =3D "passive"; + }; + gpu1_crit: trip-crit { temperature =3D <100000>; hysteresis =3D <2000>; @@ -2710,11 +2734,17 @@ gpu1_crit: trip-crit { }; =20 vdec-thermal { - polling-delay =3D <0>; - polling-delay-passive =3D <0>; + polling-delay =3D <1000>; + polling-delay-passive =3D <250>; thermal-sensors =3D <&lvts_ap MT8195_AP_VDEC>; =20 trips { + vdec_alert: trip-alert { + temperature =3D <85000>; + hysteresis =3D <2000>; + type =3D "passive"; + }; + vdec_crit: trip-crit { temperature =3D <100000>; hysteresis =3D <2000>; @@ -2724,11 +2754,17 @@ vdec_crit: trip-crit { }; =20 img-thermal { - polling-delay =3D <0>; - polling-delay-passive =3D <0>; + polling-delay =3D <1000>; + polling-delay-passive =3D <250>; thermal-sensors =3D <&lvts_ap MT8195_AP_IMG>; =20 trips { + img_alert: trip-alert { + temperature =3D <85000>; + hysteresis =3D <2000>; + type =3D "passive"; + }; + img_crit: trip-crit { temperature =3D <100000>; hysteresis =3D <2000>; @@ -2738,11 +2774,17 @@ img_crit: trip-crit { }; =20 infra-thermal { - polling-delay =3D <0>; - polling-delay-passive =3D <0>; + polling-delay =3D <1000>; + polling-delay-passive =3D <250>; thermal-sensors =3D <&lvts_ap MT8195_AP_INFRA>; =20 trips { + infra_alert: trip-alert { + temperature =3D <85000>; + hysteresis =3D <2000>; + type =3D "passive"; + }; + infra_crit: trip-crit { temperature =3D <100000>; hysteresis =3D <2000>; @@ -2752,11 +2794,17 @@ infra_crit: trip-crit { }; =20 cam0-thermal { - polling-delay =3D <0>; - polling-delay-passive =3D <0>; + polling-delay =3D <1000>; + polling-delay-passive =3D <250>; thermal-sensors =3D <&lvts_ap MT8195_AP_CAM0>; =20 trips { + cam0_alert: trip-alert { + temperature =3D <85000>; + hysteresis =3D <2000>; + type =3D "passive"; + }; + cam0_crit: trip-crit { temperature =3D <100000>; hysteresis =3D <2000>; @@ -2766,11 +2814,17 @@ cam0_crit: trip-crit { }; =20 cam1-thermal { - polling-delay =3D <0>; - polling-delay-passive =3D <0>; + polling-delay =3D <1000>; + polling-delay-passive =3D <250>; thermal-sensors =3D <&lvts_ap MT8195_AP_CAM1>; =20 trips { + cam1_alert: trip-alert { + temperature =3D <85000>; + hysteresis =3D <2000>; + type =3D "passive"; + }; + cam1_crit: trip-crit { temperature =3D <100000>; hysteresis =3D <2000>; --=20 2.34.1