Received: by 2002:a05:7412:40d:b0:e2:908c:2ebd with SMTP id 13csp354377rdf; Tue, 21 Nov 2023 04:51:57 -0800 (PST) X-Google-Smtp-Source: AGHT+IG/xCmnYaA3ujFcuczp1OeFE88zSTn0Y5XRDu8DBgq93YhU00ue9VFHci1i8qiMaraUbYLl X-Received: by 2002:a17:90b:1b10:b0:274:7db1:f50f with SMTP id nu16-20020a17090b1b1000b002747db1f50fmr3892427pjb.15.1700571116814; Tue, 21 Nov 2023 04:51:56 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1700571116; cv=none; d=google.com; s=arc-20160816; b=TcKjiLGZIl+bPH6TO681pyHlTQK8gpQlC2b993n42jvb+VetqWiDLZI15GavzClHro TusiiqEaRegnb5WPFGo8A0QUrdXw9kWo8/VGvINUuEpTC/x8KotJ+4MGNmBl7rIceTGK Y2txZHm7xPwKaj7sh2tFBc3D6tbSvP96bhyAyR1XTYTupf3Vrr4inkdxlKCio8UyR47N RVOsYgH1TiDi6P7VCFStqVY3PX8HkUqLkJNOXJ50zd57Ah5LnDZAYQ22F9A5xX+hfc2b WGH+M6Szl4435ctUabk9HJkZH9ba9je+WJfLldMXURYpt8aeD8wR5zWTu3ORqxFV9q7I Xqww== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :message-id:date:subject:cc:to:from:dkim-signature; bh=rJq0nYUYVtPFAXj5Kr3bmgy9QALrYNlLuzgeYnIos/o=; fh=m5p6pcg3y47Sg5VKYWXj0f0nOzgFq4l5+GGYwGce+t4=; b=P1w3i8m65MjLPcwajL0VwyuoP+5VyTB/nzLHE2ko4hgK5Ir9NLtPezhX6RWtR59HyN qyW9zCFSlrxDIgI2xKjkW64trnU+5EwZt4ATt+25sdAem/pQtGGkhE2+7WeukVvn/wpk /LYzxjVw9fitINiS9FQLI9OXEQ47yGHUliIW971prxZ+LBxuEIRB7spqfRJ69/0l6gyk 2eILB356jQWe3An1t82fx7x8sj9kkrZ6KqQBoa9/Jprtsci7VAf18ONb1TC5nMzdn6ZV qKWjR1HfOT91kW+XgWePf5T6EXM4baHG1/MbRP3q8US7TNeMl0ApMbApWchPipShkyXj j/cA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@collabora.com header.s=mail header.b=U1taiTBr; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:8 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=collabora.com Return-Path: Received: from fry.vger.email (fry.vger.email. [2620:137:e000::3:8]) by mx.google.com with ESMTPS id mj12-20020a17090b368c00b00284eb6ee925si7285148pjb.92.2023.11.21.04.51.56 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 21 Nov 2023 04:51:56 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:8 as permitted sender) client-ip=2620:137:e000::3:8; Authentication-Results: mx.google.com; dkim=pass header.i=@collabora.com header.s=mail header.b=U1taiTBr; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:8 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=collabora.com Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by fry.vger.email (Postfix) with ESMTP id 62B6F80275AD; Tue, 21 Nov 2023 04:51:23 -0800 (PST) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.11 at fry.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233504AbjKUMu5 (ORCPT + 99 others); Tue, 21 Nov 2023 07:50:57 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:56406 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230458AbjKUMu4 (ORCPT ); Tue, 21 Nov 2023 07:50:56 -0500 Received: from madras.collabora.co.uk (madras.collabora.co.uk [IPv6:2a00:1098:0:82:1000:25:2eeb:e5ab]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id A6B871AA; Tue, 21 Nov 2023 04:50:52 -0800 (PST) Received: from IcarusMOD.eternityproject.eu (cola.collaboradmins.com [195.201.22.229]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) (Authenticated sender: kholk11) by madras.collabora.co.uk (Postfix) with ESMTPSA id 63E306607314; Tue, 21 Nov 2023 12:50:50 +0000 (GMT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=collabora.com; s=mail; t=1700571051; bh=tChGrRD783h6BgpHePb4MPftUfyiwkFDBoUMzwOe+Ts=; h=From:To:Cc:Subject:Date:From; b=U1taiTBrm7oRGIdK+/S0PbjT1BwBrSnI9B8N2OiLGt99ocohaB+aq3vQALxDVVA0q jvZSBjW3OQaxPg9BayWVt2so4fgk0TrdEH8Q/hV17tHdehsEcVM82G8uHmtf80YRf1 wSXO56qeGRY8Q+78mF6fd8uhPLov3Uf0H/fd8bAZyCphc4UMxEP8OBg9qE8rhGIWX9 KeTftokLvZYhDnBaBruhmTDHJSHJPi81o0GVA4difTFJ9eAb3BJLBjyTQLzSLuRluV my2EtRf0TeTvjABGAviX0pdrsDKevSakBHLoyXU1v+wkNmq+bmJf+a36X+lPNQ/f9n 6p0xyp88TcAOw== From: AngeloGioacchino Del Regno To: matthias.bgg@gmail.com Cc: krzysztof.kozlowski+dt@linaro.org, conor+dt@kernel.org, robh+dt@kernel.org, angelogioacchino.delregno@collabora.com, p.zabel@pengutronix.de, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-mediatek@lists.infradead.org, kernel@collabora.com, wenst@chromium.org Subject: [PATCH v3 00/20] MediaTek SVS driver partial refactoring Date: Tue, 21 Nov 2023 13:50:24 +0100 Message-ID: <20231121125044.78642-1-angelogioacchino.delregno@collabora.com> X-Mailer: git-send-email 2.42.0 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-0.9 required=5.0 tests=DKIM_SIGNED,DKIM_VALID, DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI, SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on fry.vger.email Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.6.4 (fry.vger.email [0.0.0.0]); Tue, 21 Nov 2023 04:51:23 -0800 (PST) Changes in v3: - Fix patch [18/20] for tzone_name moved to pdata Changes in v2: - Fixed some style issues in patch [18/20] This is a partial refactoring of the MediaTek Smart Voltage Scaling driver. Long story short: this driver never worked as expected on any platform because of various issues so in this series there are some changes that will break compatibility with older device trees (of which, only MT8183 ever had the SVS node), but those are acceptable because... it never really worked fine anyway, so there's no regression. This series was tested on MT8186, MT8192, MT8195 Chromebooks. Depends on MT8192 thermal node: https://lore.kernel.org/lkml/20231017190545.157282-5-bero@baylibre.com/ MT8186 and MT8195 SVS support: https://lore.kernel.org/all/20231011034307.24641-1-chun-jen.tseng@mediatek.com/ Note: one commit was omitted because I haven't got feedback yet on the thermal-zones devicetree consumers implementation at [1], but I still wanted to send this series to the lists to get feedback. Please keep in mind that the one omitted commit is supposed to go on top of this series anyway, and that an useful example of how the SVS node will look with the DT thermal zones is provided at [1]. [1]: https://lore.kernel.org/all/20231115144857.424005-1-angelogioacchino.delregno@collabora.com/ AngeloGioacchino Del Regno (20): arm64: dts: mediatek: mt8183: Change iospaces for thermal and svs soc: mediatek: mtk-svs: Subtract offset from regs_v2 to avoid conflict soc: mediatek: mtk-svs: Convert sw_id and type to enumerations soc: mediatek: mtk-svs: Build bank name string dynamically soc: mediatek: mtk-svs: Reduce memory footprint of struct svs_bank soc: mediatek: mtk-svs: Change the thermal sensor device name soc: mediatek: mtk-svs: Add a map to retrieve fused values soc: mediatek: mtk-svs: Add SVS-Thermal coefficient to SoC platform data soc: mediatek: mtk-svs: Move t-calibration-data retrieval to svs_probe() soc: mediatek: mtk-svs: Commonize efuse parse function for most SoCs soc: mediatek: mtk-svs: Drop supplementary svs per-bank pointer soc: mediatek: mtk-svs: Commonize MT8192 probe function for MT8186 soc: mediatek: mtk-svs: Remove redundant print in svs_get_efuse_data soc: mediatek: mtk-svs: Compress of_device_id entries soc: mediatek: mtk-svs: Cleanup of svs_probe() function soc: mediatek: mtk-svs: Check if SVS mode is available in the beginning soc: mediatek: mtk-svs: Use ULONG_MAX to compare floor frequency soc: mediatek: mtk-svs: Constify runtime-immutable members of svs_bank arm64: dts: mediatek: mt8192: Add Smart Voltage Scaling node arm64: dts: mediatek: mt8195: Add SVS node and reduce LVTS_AP iospace arch/arm64/boot/dts/mediatek/mt8183.dtsi | 26 +- arch/arm64/boot/dts/mediatek/mt8192.dtsi | 12 + arch/arm64/boot/dts/mediatek/mt8195.dtsi | 17 +- drivers/soc/mediatek/mtk-svs.c | 2002 +++++++++++----------- 4 files changed, 996 insertions(+), 1061 deletions(-) -- 2.42.0