From patchwork Mon Oct 2 18:59:35 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Dmitry Baryshkov X-Patchwork-Id: 728917 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 A37BEE74915 for ; Mon, 2 Oct 2023 18:59:47 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S238493AbjJBS7s (ORCPT ); Mon, 2 Oct 2023 14:59:48 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:58032 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S238509AbjJBS7r (ORCPT ); Mon, 2 Oct 2023 14:59:47 -0400 Received: from mail-lf1-x134.google.com (mail-lf1-x134.google.com [IPv6:2a00:1450:4864:20::134]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 14391B8 for ; Mon, 2 Oct 2023 11:59:44 -0700 (PDT) Received: by mail-lf1-x134.google.com with SMTP id 2adb3069b0e04-50435a9f800so32366e87.2 for ; Mon, 02 Oct 2023 11:59:43 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1696273182; x=1696877982; darn=vger.kernel.org; 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=zXetwuwd7eyQ9A3g1yCGm8/1oY3jPgf1yMAkZGiV+mc=; b=SPkqjC6IJnIPlumbAYm4nu9q2TgH4/KlMAFeFaXF3nXK/lO1Cb7ObacoaNmJ0fYkID +2CWF7W4kWERi3dke9Bc7ga4bE7GvH/vr974woxskuqdw79/lIBvsj9tOfnvnzrl3S/F 7izcsyX8wIFk69U5Tto1Me4+R7FHUJLwhMJo+SloVLOSZgAVTYTjYRjxpBNA+/VYbTOV cNROSXJiDHK7nV7pC0CS9uMSLsDDI2MGbCGWRAQQ5JdEmqz53qMhvgjKOcZ9a0NFKBK6 t7aNoYTRVSeYGbUwaTERS5DLgxqxsc4NSmufJoVGN7yhPkozAp2xgERbSU8It1H+S5rv LUfA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1696273182; x=1696877982; 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=zXetwuwd7eyQ9A3g1yCGm8/1oY3jPgf1yMAkZGiV+mc=; b=ava1Da2ZAuobI/zCr+DAagdZGzTAQi/9gHQTX/gKu5AxnoQrkkte7K7updO5dXH7OA cZhRmgTVhjSdgB7SoxJQ+lQhPZ2bFOrthMRzrPJyJPs5y1IB69oPXpCyJO9PD3aj8tG0 MgjlR5rWMiDeoMs9u9Hkd6tohf5+T6OE5ANLZxUe/8WZPpQXQULLI2hpdaR4y5aLHUeK AS6OocrKqKrXoeZ/nq/lDBEtY8b3CoioV43NiHO+eNG1UbmZzvFyYPX/+PZXl40otkya H2GHNnowIQ2uZfw2RV/6kEAjoikqaMLH+BGCLBPxLfd0hoofDLLoYJ9v9AHm+rpV0IUr I3DA== X-Gm-Message-State: AOJu0Yyjo2VTHfbJuOLmeEkAk4x3TG3DAHHPnhSIYpBw9CLWXvTuNi39 weA21AAausQPOCyR0orjyLXXAw== X-Google-Smtp-Source: AGHT+IHw0bsKYu/a7Q4FTDbZaZhUadyxYML+nweVMGrn9ermZvYwwiCn7W5vccf+ApXG4a+qB5yerw== X-Received: by 2002:a05:6512:ea1:b0:503:2642:435e with SMTP id bi33-20020a0565120ea100b005032642435emr11407227lfb.66.1696273181901; Mon, 02 Oct 2023 11:59:41 -0700 (PDT) Received: from umbar.unikie.fi ([192.130.178.91]) by smtp.gmail.com with ESMTPSA id t6-20020a19ad06000000b00502d7365e8fsm2443981lfc.137.2023.10.02.11.59.41 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 02 Oct 2023 11:59:41 -0700 (PDT) From: Dmitry Baryshkov To: Rob Herring , Krzysztof Kozlowski , Conor Dooley , Andy Gross , Bjorn Andersson , Konrad Dybcio , Ilia Lin , Viresh Kumar , Nishanth Menon , Stephen Boyd , Michael Turquette , "Rafael J. Wysocki" , Georgi Djakov Cc: linux-arm-msm@vger.kernel.org, devicetree@vger.kernel.org, linux-pm@vger.kernel.org, linux-clk@vger.kernel.org, Christian Marangi , Stephan Gerhold , Rob Herring Subject: [PATCH v5 1/6] dt-bindings: opp: opp-v2-kryo-cpu: support Qualcomm Krait SoCs Date: Mon, 2 Oct 2023 21:59:35 +0300 Message-Id: <20231002185940.1271800-2-dmitry.baryshkov@linaro.org> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20231002185940.1271800-1-dmitry.baryshkov@linaro.org> References: <20231002185940.1271800-1-dmitry.baryshkov@linaro.org> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: linux-arm-msm@vger.kernel.org Exted the opp-v2-kryo-cpu.yaml to support defining OPP tables for the previous generation of Qualcomm CPUs, 32-bit Krait-based platforms. It makes no sense to use 'operating-points-v2-kryo-cpu' compatibility node for the Krait cores. Add support for the Krait-specific 'operating-points-v2-krait-cpu' compatibility string and the relevant opp-microvolt subclasses properties. The listed opp-supported-hw values are applicable only to msm8996 / msm8996pro platforms. Remove the enum as other platforms will use other bit values. It makes little sense to list all possible values for all the platforms here. Acked-by: Rob Herring Signed-off-by: Dmitry Baryshkov --- .../devicetree/bindings/opp/opp-v2-kryo-cpu.yaml | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/Documentation/devicetree/bindings/opp/opp-v2-kryo-cpu.yaml b/Documentation/devicetree/bindings/opp/opp-v2-kryo-cpu.yaml index 27ea7eca73e5..316f9c7804e4 100644 --- a/Documentation/devicetree/bindings/opp/opp-v2-kryo-cpu.yaml +++ b/Documentation/devicetree/bindings/opp/opp-v2-kryo-cpu.yaml @@ -26,7 +26,9 @@ description: | properties: compatible: - const: operating-points-v2-kryo-cpu + enum: + - operating-points-v2-krait-cpu + - operating-points-v2-kryo-cpu nvmem-cells: description: | @@ -65,14 +67,16 @@ patternProperties: 5: MSM8996SG, speedbin 1 6: MSM8996SG, speedbin 2 7-31: unused - enum: [0x1, 0x2, 0x3, 0x4, 0x5, 0x6, 0x7, - 0x9, 0xd, 0xe, 0xf, - 0x10, 0x20, 0x30, 0x70] + + Other platforms use bits directly corresponding to speedbin index. clock-latency-ns: true required-opps: true + patternProperties: + '^opp-microvolt-speed[0-9]+-pvs[0-9]+$': true + required: - opp-hz From patchwork Mon Oct 2 18:59:36 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Dmitry Baryshkov X-Patchwork-Id: 728916 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 60CFEE74918 for ; Mon, 2 Oct 2023 18:59:48 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S238521AbjJBS7t (ORCPT ); Mon, 2 Oct 2023 14:59:49 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:59126 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S238512AbjJBS7s (ORCPT ); Mon, 2 Oct 2023 14:59:48 -0400 Received: from mail-lf1-x12a.google.com (mail-lf1-x12a.google.com [IPv6:2a00:1450:4864:20::12a]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 931E5E1 for ; Mon, 2 Oct 2023 11:59:44 -0700 (PDT) Received: by mail-lf1-x12a.google.com with SMTP id 2adb3069b0e04-503f39d3236so49618e87.0 for ; Mon, 02 Oct 2023 11:59:44 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1696273182; x=1696877982; darn=vger.kernel.org; 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=uUMMYHvgPHC3FfvjsnckoOJeoQiZG6ia/eSTyXFZQWY=; b=ZhI8t8stGzgFJbpADZZ5VJoJGDvPoaxXXcKMlhIUM22511S9yUN2bRwROclKU+ugfw kwZAureA2ymlIctRf/9KGeuNXRON1zE4KVClgIZbR1s2LidbVuiR5kC2j2TDsTmvOHFY 3S4dclPNG7O1MYZnDC5V5NQC/ntpU6VrVY6V2urEmpewgCSLl7xYcppIC6XPYIkjCj6e JCwcfVSBAXG3jWlG3FzxScwSgR13gzQXP66dD05sausEjOfXblPwQOGgfHZzyamrt2py WNL9j1kIComsU2cLllR+ZVHn30UYb1ytCmXiwIISHEjoZc79WFPRXdQa5Eg/x9fdioZQ W+nw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1696273183; x=1696877983; 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=uUMMYHvgPHC3FfvjsnckoOJeoQiZG6ia/eSTyXFZQWY=; b=sKyn+MyvVYZZS1fsPcRSSax6HqMTrZB5khZHCF3402enDQoYDEKn/R3zlDdJEZhc7w r985/YQy9sJKOaZQt/iqrYtYn4nbyuVWEALIJB13SRiGPSK8sYdhNZ9GW2L6jtGVfo2T +uNxuQxY5kLVNsYzFAOm7oH21y8hbBa3ZowdQCYT6nRW78dZENMK/fUamPWuTz+DCgXg Q6YuHUKTkoO4ShbL00slnLJPuoQsZ9LSI8NuZKqksGMkhtu2r9Aa1y84A50C/t0XBeAi /yNRA4o3O12hc69nECBg60IH08EPKohIaBr6HIdP3uFlS9flm4zPMfmY5aP8aZLy6tyn 6WmA== X-Gm-Message-State: AOJu0YwvYdt7VzM80TwyEVJiTwtRFBqIKWSzl7ot5ad/8EpCCE4wevGJ Gi4gr8YS8mKZyD46+N0H73YVTw== X-Google-Smtp-Source: AGHT+IEgxFY+35KvD5H3tSxWVYVRmZNUF09HNGbEzDO2oFLSFdd5IOhZLmpK+kmZLitoT04UbgVrRg== X-Received: by 2002:a19:f814:0:b0:503:343a:829f with SMTP id a20-20020a19f814000000b00503343a829fmr9526676lff.23.1696273182683; Mon, 02 Oct 2023 11:59:42 -0700 (PDT) Received: from umbar.unikie.fi ([192.130.178.91]) by smtp.gmail.com with ESMTPSA id t6-20020a19ad06000000b00502d7365e8fsm2443981lfc.137.2023.10.02.11.59.42 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 02 Oct 2023 11:59:42 -0700 (PDT) From: Dmitry Baryshkov To: Rob Herring , Krzysztof Kozlowski , Conor Dooley , Andy Gross , Bjorn Andersson , Konrad Dybcio , Ilia Lin , Viresh Kumar , Nishanth Menon , Stephen Boyd , Michael Turquette , "Rafael J. Wysocki" , Georgi Djakov Cc: linux-arm-msm@vger.kernel.org, devicetree@vger.kernel.org, linux-pm@vger.kernel.org, linux-clk@vger.kernel.org, Christian Marangi , Stephan Gerhold Subject: [PATCH v5 2/6] cpufreq: qcom-nvmem: create L2 cache device Date: Mon, 2 Oct 2023 21:59:36 +0300 Message-Id: <20231002185940.1271800-3-dmitry.baryshkov@linaro.org> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20231002185940.1271800-1-dmitry.baryshkov@linaro.org> References: <20231002185940.1271800-1-dmitry.baryshkov@linaro.org> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: linux-arm-msm@vger.kernel.org Scaling the frequencies on some of Qualcomm Krait platforms (e.g. APQ8064) also requires scaling of the L2 cache frequency. As the l2-cache device node is places under /cpus/ path, it is not created by default by the OF code. Create corresponding device here. Signed-off-by: Dmitry Baryshkov --- drivers/cpufreq/qcom-cpufreq-nvmem.c | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) diff --git a/drivers/cpufreq/qcom-cpufreq-nvmem.c b/drivers/cpufreq/qcom-cpufreq-nvmem.c index 84d7033e5efe..919f2ee9cafe 100644 --- a/drivers/cpufreq/qcom-cpufreq-nvmem.c +++ b/drivers/cpufreq/qcom-cpufreq-nvmem.c @@ -22,6 +22,7 @@ #include #include #include +#include #include #include #include @@ -377,6 +378,7 @@ static int __init qcom_cpufreq_init(void) { struct device_node *np = of_find_node_by_path("/"); const struct of_device_id *match; + unsigned int cpu; int ret; if (!np) @@ -387,6 +389,25 @@ static int __init qcom_cpufreq_init(void) if (!match) return -ENODEV; + for_each_possible_cpu(cpu) { + struct device *dev = get_cpu_device(cpu); + struct platform_device *pdev; + struct device_node *cache; + + cache = of_find_next_cache_node(dev->of_node); + if (!cache) + continue; + + if (of_device_is_compatible(cache, "qcom,krait-l2-cache")) { + pdev = of_platform_device_create(cache, NULL, NULL); + /* ignore, this error is not fatal */ + if (!pdev) + pr_err("%s: %pe, failed to create L2 cache node\n", __func__, pdev); + } + + of_node_put(cache); + } + ret = platform_driver_register(&qcom_cpufreq_driver); if (unlikely(ret < 0)) return ret; From patchwork Mon Oct 2 18:59:37 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Dmitry Baryshkov X-Patchwork-Id: 728595 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 087F7E77361 for ; Mon, 2 Oct 2023 18:59:49 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S238513AbjJBS7t (ORCPT ); Mon, 2 Oct 2023 14:59:49 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:59196 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S238517AbjJBS7s (ORCPT ); Mon, 2 Oct 2023 14:59:48 -0400 Received: from mail-lf1-x12b.google.com (mail-lf1-x12b.google.com [IPv6:2a00:1450:4864:20::12b]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 401B1E9 for ; Mon, 2 Oct 2023 11:59:45 -0700 (PDT) Received: by mail-lf1-x12b.google.com with SMTP id 2adb3069b0e04-503065c4b25so42081e87.1 for ; Mon, 02 Oct 2023 11:59:45 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1696273183; x=1696877983; darn=vger.kernel.org; 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=A+56KXdnxE65EkSdZoHmKszExF8hRCz4jAuhqSaYx84=; b=RHtJpeqpvfvlEYHBRlj6P931QKBBieNT+gIGCfhsSrk7Qx3Fnbqi84lTKZ9gB08rIx G92ni8UhydGa3ds+lHd9dUOIycLQL6Kk+t2SAbZ1qXlqGM6/y95CxxbNEQCCqsqoQ9eQ OmmgeJLBDVwh6KKvY6dY3aYNOZxxcIaxB8Y5cCU6ueG47hZp+fdipJN1Gj78zvmery4Q V90txEuWk2DCDhBu7kAOUSZRPUY0kvjALZHg9UPwfelTdYS5zMt0mkymrn/Wb5SEm24U JWTTtmftGdM+bL+oIo7/QihwVQDABxuI9McCDy/IGazX0KN2z0HOeVGTEv/RiDfFCpKH S3AA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1696273183; x=1696877983; 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=A+56KXdnxE65EkSdZoHmKszExF8hRCz4jAuhqSaYx84=; b=tywQvSOIPsA2t3gTAb42GKQrncnVTAYN5Vi722LFSKN9aWw7q482Bm4jF4MnrqOKql aoAbeLLYlu6KQk8NG32eeKsxUZfUmJjoLNZljvtjXzHvyP33XVDkJ/TgdXEJg8AwL+HO jAA3aAGwYh6EqE4v1M3BdjiJHp3PSohGO4H/VRttwTVmTm23nmICuHD7jHPxmQi7LU65 4/+3ZYJykKZ5cyK8mxCqkE8sv0tdR1XCUkKgfPWVrhlewIzPMx5QEIuCQX8GtLPfZjxg Pqg/bbOuy9rXke3CHqOMwGuj5XcouQTi56jIakXh6e66ONLL5qNBHPi9V25xNh3le+fE tLJA== X-Gm-Message-State: AOJu0YzEDH6OYBr7Ez92MFu9TTK8WXOyilT9MFbdY0PyGCo7+aDQ9RNN HM0lYswjahJ0K4aA3sQVFN+ATQ== X-Google-Smtp-Source: AGHT+IGsvZCvt/wf7r/3mXfcPjQ5EYeujepsUhoo6d+dKmFSmHIRZsTUCxc9T6L/QX6onz8XGVW1lw== X-Received: by 2002:a05:6512:5cf:b0:500:92f1:c341 with SMTP id o15-20020a05651205cf00b0050092f1c341mr9311900lfo.54.1696273183479; Mon, 02 Oct 2023 11:59:43 -0700 (PDT) Received: from umbar.unikie.fi ([192.130.178.91]) by smtp.gmail.com with ESMTPSA id t6-20020a19ad06000000b00502d7365e8fsm2443981lfc.137.2023.10.02.11.59.42 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 02 Oct 2023 11:59:43 -0700 (PDT) From: Dmitry Baryshkov To: Rob Herring , Krzysztof Kozlowski , Conor Dooley , Andy Gross , Bjorn Andersson , Konrad Dybcio , Ilia Lin , Viresh Kumar , Nishanth Menon , Stephen Boyd , Michael Turquette , "Rafael J. Wysocki" , Georgi Djakov Cc: linux-arm-msm@vger.kernel.org, devicetree@vger.kernel.org, linux-pm@vger.kernel.org, linux-clk@vger.kernel.org, Christian Marangi , Stephan Gerhold Subject: [PATCH v5 3/6] cpufreq: qcom-nvmem: also accept operating-points-v2-krait-cpu Date: Mon, 2 Oct 2023 21:59:37 +0300 Message-Id: <20231002185940.1271800-4-dmitry.baryshkov@linaro.org> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20231002185940.1271800-1-dmitry.baryshkov@linaro.org> References: <20231002185940.1271800-1-dmitry.baryshkov@linaro.org> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: linux-arm-msm@vger.kernel.org the qcom-cpufreq-nvmem driver attempts to support both Qualcomm Kryo (newer 64-bit ARMv8 cores) and Krait (older 32-bit ARMv7 cores). It makes no sense to use 'operating-points-v2-kryo-cpu' compatibility node for the Krait cores. Add support for 'operating-points-v2-krait-cpu' compatibility string. Reviewed-by: Konrad Dybcio Signed-off-by: Dmitry Baryshkov --- drivers/cpufreq/qcom-cpufreq-nvmem.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/drivers/cpufreq/qcom-cpufreq-nvmem.c b/drivers/cpufreq/qcom-cpufreq-nvmem.c index 919f2ee9cafe..9db060bed742 100644 --- a/drivers/cpufreq/qcom-cpufreq-nvmem.c +++ b/drivers/cpufreq/qcom-cpufreq-nvmem.c @@ -238,7 +238,8 @@ static int qcom_cpufreq_probe(struct platform_device *pdev) if (!np) return -ENOENT; - ret = of_device_is_compatible(np, "operating-points-v2-kryo-cpu"); + ret = of_device_is_compatible(np, "operating-points-v2-kryo-cpu") || + of_device_is_compatible(np, "operating-points-v2-krait-cpu"); if (!ret) { of_node_put(np); return -ENOENT; From patchwork Mon Oct 2 18:59:38 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Dmitry Baryshkov X-Patchwork-Id: 728915 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 B2DA2E77364 for ; Mon, 2 Oct 2023 18:59:49 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S238518AbjJBS7u (ORCPT ); Mon, 2 Oct 2023 14:59:50 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:59216 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S238509AbjJBS7s (ORCPT ); Mon, 2 Oct 2023 14:59:48 -0400 Received: from mail-lf1-x12b.google.com (mail-lf1-x12b.google.com [IPv6:2a00:1450:4864:20::12b]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id E2A19AC for ; Mon, 2 Oct 2023 11:59:45 -0700 (PDT) Received: by mail-lf1-x12b.google.com with SMTP id 2adb3069b0e04-50444e756deso53788e87.0 for ; Mon, 02 Oct 2023 11:59:45 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1696273184; x=1696877984; darn=vger.kernel.org; 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=q1heHX5rrMSY/dD5UhqY1PvNOm7/fsl8X1S0Buse7vI=; b=KFzFKDfAuRSCyHScI07yudPn/bRwNHkYt5A2wQb3QN4o9aFgFydRW63d73SpIB6aqV c+zTHVzgsmD/YbakYfTeKqdcrcVw72htWpCF4V6xLxV4OuMn49eO1QkHW3TQHKhWeO04 XiuBT6B43meZj7I/TeUXigrYV+QmCJ+WOEDSIaLCjMKLDbVm+Xs+77SKxiyD/9Vrjvh9 WwC9RxR3OSIOjhJGE6QgYQW/ldggnhl/Q4mD/EGeijNDReVClLLzyHu8YJoOto6rNI+u v2g/ICijeowUNMu6JUmgjwhQk3i4Hx6TLOc+8J/EWiI3ExvFR3nukih0pfkxy5cw6EHy VG0w== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1696273184; x=1696877984; 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=q1heHX5rrMSY/dD5UhqY1PvNOm7/fsl8X1S0Buse7vI=; b=JYbtiXfPrWDptlbzo+ZNuatWoQq7apeZ6LGdPNVdjDTwwjHqCo520LKAJ/0hk0jrGP K0G3h82cFBPLiDOyEjBhgUWW1P4Ogg+MjWRK/qB1h8kZ8JZvZMeR9qy2uI+yG+Dd7aID rPiUG7LtT3QTeOCls5NbYaKC/wMtKfhV8GAE8ycvSP+x0GJ58XFWy/iQr/bauo4l697c w8l5LNGUHTDwVSwFRD8Z8o07sEv7dySwrT8quxCWmUMWA83bkNmNzSx3i/LnT2b6myip 3dKXrnqUP2VxXHLqMK2EXrr2pOVyOaYEZLh/gmZmBA6bc+VdsPvkyQORKpXmr/3u9vqk TCnQ== X-Gm-Message-State: AOJu0YwgqEletWmsoXPX0L2pJOku/iwsYTkTyn8Go2teNA0moWvYbQ6a M+2AIJRU0fPy8YEi+SeCU6RzfA== X-Google-Smtp-Source: AGHT+IHr19H6Cze+Q47I7x1qKrppOYVudyg44AYVTgEBEL5dGi26gc6A6DWuFqw85i0NUnco5CEOvw== X-Received: by 2002:a05:6512:3d10:b0:500:7a23:720b with SMTP id d16-20020a0565123d1000b005007a23720bmr13652498lfv.55.1696273184283; Mon, 02 Oct 2023 11:59:44 -0700 (PDT) Received: from umbar.unikie.fi ([192.130.178.91]) by smtp.gmail.com with ESMTPSA id t6-20020a19ad06000000b00502d7365e8fsm2443981lfc.137.2023.10.02.11.59.43 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 02 Oct 2023 11:59:43 -0700 (PDT) From: Dmitry Baryshkov To: Rob Herring , Krzysztof Kozlowski , Conor Dooley , Andy Gross , Bjorn Andersson , Konrad Dybcio , Ilia Lin , Viresh Kumar , Nishanth Menon , Stephen Boyd , Michael Turquette , "Rafael J. Wysocki" , Georgi Djakov Cc: linux-arm-msm@vger.kernel.org, devicetree@vger.kernel.org, linux-pm@vger.kernel.org, linux-clk@vger.kernel.org, Christian Marangi , Stephan Gerhold Subject: [PATCH v5 4/6] cpufreq: qcom-nvmem: drop pvs_ver for format a fuses Date: Mon, 2 Oct 2023 21:59:38 +0300 Message-Id: <20231002185940.1271800-5-dmitry.baryshkov@linaro.org> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20231002185940.1271800-1-dmitry.baryshkov@linaro.org> References: <20231002185940.1271800-1-dmitry.baryshkov@linaro.org> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: linux-arm-msm@vger.kernel.org The fuses used on msm8960 / apq8064 / ipq806x families of devices do not have the pvs version. Drop this argument from parsing function. Reviewed-by: Konrad Dybcio Signed-off-by: Dmitry Baryshkov --- drivers/cpufreq/qcom-cpufreq-nvmem.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/drivers/cpufreq/qcom-cpufreq-nvmem.c b/drivers/cpufreq/qcom-cpufreq-nvmem.c index 9db060bed742..e5c17d9f5a24 100644 --- a/drivers/cpufreq/qcom-cpufreq-nvmem.c +++ b/drivers/cpufreq/qcom-cpufreq-nvmem.c @@ -50,7 +50,7 @@ struct qcom_cpufreq_drv { static struct platform_device *cpufreq_dt_pdev, *cpufreq_pdev; static void get_krait_bin_format_a(struct device *cpu_dev, - int *speed, int *pvs, int *pvs_ver, + int *speed, int *pvs, u8 *buf) { u32 pte_efuse; @@ -181,8 +181,7 @@ static int qcom_cpufreq_krait_name_version(struct device *cpu_dev, switch (len) { case 4: - get_krait_bin_format_a(cpu_dev, &speed, &pvs, &pvs_ver, - speedbin); + get_krait_bin_format_a(cpu_dev, &speed, &pvs, speedbin); break; case 8: get_krait_bin_format_b(cpu_dev, &speed, &pvs, &pvs_ver, From patchwork Mon Oct 2 18:59:39 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Dmitry Baryshkov X-Patchwork-Id: 728914 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 54AD5E74911 for ; Mon, 2 Oct 2023 18:59:50 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S238537AbjJBS7u (ORCPT ); Mon, 2 Oct 2023 14:59:50 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:59228 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S238520AbjJBS7t (ORCPT ); Mon, 2 Oct 2023 14:59:49 -0400 Received: from mail-lf1-x12e.google.com (mail-lf1-x12e.google.com [IPv6:2a00:1450:4864:20::12e]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id D7BB8E1 for ; Mon, 2 Oct 2023 11:59:46 -0700 (PDT) Received: by mail-lf1-x12e.google.com with SMTP id 2adb3069b0e04-50435a9f800so32408e87.2 for ; Mon, 02 Oct 2023 11:59:46 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1696273185; x=1696877985; darn=vger.kernel.org; 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=2jjTNnguvLOGzQRpp4J4p+5ap6mcEJVkzoAyjCrZDG0=; b=NQ2jQ/OFw/PTK1BnEpgfXw0gQY1B6T6VWOtV2+gPJ9XYDEOfgrnJc2S3dOoh9aT6E7 DjoEhl+0un/5nhJOnP06zXn1KhPMoc0svDl29u3mpI3yhlQ43fhWHUvLf8GLUwejL1El mP3fA2cFAHogS3aD6me1+vlvr0ybcz/UJ77KJTM1gxMN8+IMvwfySyEq+2QOUu8WAsin n1vFIFiu4QAq8H+k1QS/OZxZuWRxT62NU9DeattywJHR4oBm92ua0M4mzQ0RB3aSEbfV nJa4byizxuaL9ORc7Q9BkJkLakdu5bvOW1sqC6LTmT5ZDXxYlGmXlg6We+bIcv7MFKL3 WtuA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1696273185; x=1696877985; 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=2jjTNnguvLOGzQRpp4J4p+5ap6mcEJVkzoAyjCrZDG0=; b=GuQJiETqjbNKTeiDfVP4ebqecNWZsNChy+qnLa9TeZrOCJZ1EU+D9MUjP8eGYTZ/9M 0amUdJbPcZVvNNFZkagcTFBYpp+N9Q6PyqOg8X3LMncq23ABn4TXkEay+ssYXQSj6eN5 y+w9JPcT7UF+d0p7tKEt1JBf88EL+7TZM/tA7FgiwdSy5NTa2IKn6auM9TICZQRO84ku aGo22sfNJa/4kAKXy0/JnhmxKE8zmwX/by+9CgXQVn0Cr3qJyRz1ZOOQvFuO/VenTvtU YzR/1r4OpDUsVGEikm3KzYmx0bd1Bk2T8/SU41NLCeZo5ZFr0iACWU1xoHCfcRHAjjvs q7Uw== X-Gm-Message-State: AOJu0YyZhFOzpm8td+pTJoeqOr7f3AIXWZqyMFmFRciNP0+iBB/6xXpm r5KKZvInQf/d6VCId/Zw3J0y/A== X-Google-Smtp-Source: AGHT+IF9di7HXMGcz4wrofKDMcmvUiyBh0pXCdwNqtXi9q6sEWgaWOUBvf+9O6tKdebgvtPgvS3+NQ== X-Received: by 2002:a05:6512:acb:b0:502:d743:9fc4 with SMTP id n11-20020a0565120acb00b00502d7439fc4mr14105432lfu.37.1696273185145; Mon, 02 Oct 2023 11:59:45 -0700 (PDT) Received: from umbar.unikie.fi ([192.130.178.91]) by smtp.gmail.com with ESMTPSA id t6-20020a19ad06000000b00502d7365e8fsm2443981lfc.137.2023.10.02.11.59.44 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 02 Oct 2023 11:59:44 -0700 (PDT) From: Dmitry Baryshkov To: Rob Herring , Krzysztof Kozlowski , Conor Dooley , Andy Gross , Bjorn Andersson , Konrad Dybcio , Ilia Lin , Viresh Kumar , Nishanth Menon , Stephen Boyd , Michael Turquette , "Rafael J. Wysocki" , Georgi Djakov Cc: linux-arm-msm@vger.kernel.org, devicetree@vger.kernel.org, linux-pm@vger.kernel.org, linux-clk@vger.kernel.org, Christian Marangi , Stephan Gerhold Subject: [PATCH v5 5/6] cpufreq: qcom-nvmem: provide separate configuration data for apq8064 Date: Mon, 2 Oct 2023 21:59:39 +0300 Message-Id: <20231002185940.1271800-6-dmitry.baryshkov@linaro.org> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20231002185940.1271800-1-dmitry.baryshkov@linaro.org> References: <20231002185940.1271800-1-dmitry.baryshkov@linaro.org> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: linux-arm-msm@vger.kernel.org APQ8064 can scale core voltage according to the frequency needs. Rather than reusing the A/B format multiplexer, use a simple fuse parsing function and configure required regulator. Signed-off-by: Dmitry Baryshkov --- drivers/cpufreq/qcom-cpufreq-nvmem.c | 49 ++++++++++++++++++++++++++-- 1 file changed, 47 insertions(+), 2 deletions(-) diff --git a/drivers/cpufreq/qcom-cpufreq-nvmem.c b/drivers/cpufreq/qcom-cpufreq-nvmem.c index e5c17d9f5a24..e1cf677b0c6f 100644 --- a/drivers/cpufreq/qcom-cpufreq-nvmem.c +++ b/drivers/cpufreq/qcom-cpufreq-nvmem.c @@ -26,6 +26,7 @@ #include #include #include +#include #include #include @@ -39,6 +40,7 @@ struct qcom_cpufreq_match_data { char **pvs_name, struct qcom_cpufreq_drv *drv); const char **genpd_names; + const char * const *regulator_names; }; struct qcom_cpufreq_drv { @@ -203,6 +205,34 @@ static int qcom_cpufreq_krait_name_version(struct device *cpu_dev, return ret; } +static int qcom_cpufreq_apq8064_name_version(struct device *cpu_dev, + struct nvmem_cell *speedbin_nvmem, + char **pvs_name, + struct qcom_cpufreq_drv *drv) +{ + int speed = 0, pvs = 0; + u8 *speedbin; + size_t len; + + speedbin = nvmem_cell_read(speedbin_nvmem, &len); + if (IS_ERR(speedbin)) + return PTR_ERR(speedbin); + + if (len != 4) + return -EINVAL; + + get_krait_bin_format_a(cpu_dev, &speed, &pvs, speedbin); + + snprintf(*pvs_name, sizeof("speedXX-pvsXX"), "speed%d-pvs%d", + speed, pvs); + + drv->versions = (1 << speed); + + kfree(speedbin); + + return 0; +} + static const struct qcom_cpufreq_match_data match_data_kryo = { .get_version = qcom_cpufreq_kryo_name_version, }; @@ -217,6 +247,16 @@ static const struct qcom_cpufreq_match_data match_data_qcs404 = { .genpd_names = qcs404_genpd_names, }; +static const char * apq8064_regulator_names[] = { + "vdd-core", + NULL +}; + +static const struct qcom_cpufreq_match_data match_data_apq8064 = { + .get_version = qcom_cpufreq_apq8064_name_version, + .regulator_names = apq8064_regulator_names, +}; + static int qcom_cpufreq_probe(struct platform_device *pdev) { struct qcom_cpufreq_drv *drv; @@ -304,7 +344,12 @@ static int qcom_cpufreq_probe(struct platform_device *pdev) config.virt_devs = NULL; } - if (config.supported_hw || config.genpd_names) { + if (drv->data->regulator_names) + config.regulator_names = drv->data->regulator_names; + + if (config.supported_hw || + config.genpd_names || + config.regulator_names) { drv->opp_tokens[cpu] = dev_pm_opp_set_config(cpu_dev, &config); if (drv->opp_tokens[cpu] < 0) { ret = drv->opp_tokens[cpu]; @@ -361,7 +406,7 @@ static const struct of_device_id qcom_cpufreq_match_list[] __initconst = { { .compatible = "qcom,msm8996", .data = &match_data_kryo }, { .compatible = "qcom,qcs404", .data = &match_data_qcs404 }, { .compatible = "qcom,ipq8064", .data = &match_data_krait }, - { .compatible = "qcom,apq8064", .data = &match_data_krait }, + { .compatible = "qcom,apq8064", .data = &match_data_apq8064 }, { .compatible = "qcom,msm8974", .data = &match_data_krait }, { .compatible = "qcom,msm8960", .data = &match_data_krait }, {}, From patchwork Mon Oct 2 18:59:40 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Dmitry Baryshkov X-Patchwork-Id: 728594 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 15C6CE77378 for ; Mon, 2 Oct 2023 18:59:51 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S238544AbjJBS7v (ORCPT ); Mon, 2 Oct 2023 14:59:51 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:59260 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S238509AbjJBS7u (ORCPT ); Mon, 2 Oct 2023 14:59:50 -0400 Received: from mail-lf1-x12a.google.com (mail-lf1-x12a.google.com [IPv6:2a00:1450:4864:20::12a]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id B779AB8 for ; Mon, 2 Oct 2023 11:59:47 -0700 (PDT) Received: by mail-lf1-x12a.google.com with SMTP id 2adb3069b0e04-503397ee920so41375e87.1 for ; Mon, 02 Oct 2023 11:59:47 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1696273186; x=1696877986; darn=vger.kernel.org; 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=ETmrOyXpzkFbupwItSkBNFCMqm+cnfW5vWqiMF83MgM=; b=KXDx19e3//Y8kt0JJre+F6jhUk0ruqw4A3TRW2+76Yj/+X9CHgG8eeu6/CsIgqTn6E NaCzrD0egxBynwKreHodsfqeg6Anra8B/pyd46VJwXi2zEEfW98lDBGbATy+Mq8LHEze kJaiFRa793vc2BsITA77TNfunGvnskZE/UrOIPlE2zZ+PE3O5gUCB9fe0RDJebclKG0r ZC6v+x1tR8q/TjPUYf/9c7gFPZyQNKM03y6NMM5lxND/gEFLM1aMOUewnr7u4EqfLVT6 iLtKMQiIoZQVYP+ky6DL7rBFMTkcxjBgnrlbVYi7hd5+ZdWqj/ZalPClaOwrO70YHT4S lRAw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1696273186; x=1696877986; 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=ETmrOyXpzkFbupwItSkBNFCMqm+cnfW5vWqiMF83MgM=; b=FDSDOYdyEQtQZcWcYojQWbNOoiyc1r3zWBjl8ofIcxLldMab15vRzY1SDYkqu1Svsy AGsw4ryb4o3u07ZbQSmg8Dmh6p3/2XuyeWYz3uHVAmHsq8DerA8TKQ0ou9RSBtYgp+QI O9rw92ZqPOTNGpAri+WXNwRBhPSkWNtnKWzrmkonN8AONWH0kEddBP78X4yx8JRf6nA0 HeIQ6F7p/moculFvQbOyg1zDjUKxR2fLd9mmZ/EHRPHjxV+ZnlxfrVxLDLdwercRUxTV cuO87NvU+eNAL2mHLI7B1gS8hwxxoW4ELuM8N49/oZnuoi/6ZcJOtjwyL72Pv9nmx0Qo kXdw== X-Gm-Message-State: AOJu0Yy6nkwZhjpsnEc0CW2ZUmUGQOg5u1jDrcVFLSINym2dsQuUPos2 TjluySjXY2zfCcl9gebgIbfTHQ== X-Google-Smtp-Source: AGHT+IGoo4epBUciQRmMmhHMfybHxLIJNCItcKoPirP6vC0ZxB9+PFXBJdN8BkE3vJgSJ2vYEEuuPA== X-Received: by 2002:a19:8c47:0:b0:500:9524:f733 with SMTP id i7-20020a198c47000000b005009524f733mr9981048lfj.20.1696273186047; Mon, 02 Oct 2023 11:59:46 -0700 (PDT) Received: from umbar.unikie.fi ([192.130.178.91]) by smtp.gmail.com with ESMTPSA id t6-20020a19ad06000000b00502d7365e8fsm2443981lfc.137.2023.10.02.11.59.45 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 02 Oct 2023 11:59:45 -0700 (PDT) From: Dmitry Baryshkov To: Rob Herring , Krzysztof Kozlowski , Conor Dooley , Andy Gross , Bjorn Andersson , Konrad Dybcio , Ilia Lin , Viresh Kumar , Nishanth Menon , Stephen Boyd , Michael Turquette , "Rafael J. Wysocki" , Georgi Djakov Cc: linux-arm-msm@vger.kernel.org, devicetree@vger.kernel.org, linux-pm@vger.kernel.org, linux-clk@vger.kernel.org, Christian Marangi , Stephan Gerhold Subject: [PATCH v5 6/6] cpufreq: qcom-nvmem: enable core voltage scaling for MSM8960 Date: Mon, 2 Oct 2023 21:59:40 +0300 Message-Id: <20231002185940.1271800-7-dmitry.baryshkov@linaro.org> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20231002185940.1271800-1-dmitry.baryshkov@linaro.org> References: <20231002185940.1271800-1-dmitry.baryshkov@linaro.org> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: linux-arm-msm@vger.kernel.org Reuse APQ8064 config for MSM8960 to enable core voltage scaling. Signed-off-by: Dmitry Baryshkov --- drivers/cpufreq/qcom-cpufreq-nvmem.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/cpufreq/qcom-cpufreq-nvmem.c b/drivers/cpufreq/qcom-cpufreq-nvmem.c index e1cf677b0c6f..6b54a674e9ea 100644 --- a/drivers/cpufreq/qcom-cpufreq-nvmem.c +++ b/drivers/cpufreq/qcom-cpufreq-nvmem.c @@ -408,7 +408,7 @@ static const struct of_device_id qcom_cpufreq_match_list[] __initconst = { { .compatible = "qcom,ipq8064", .data = &match_data_krait }, { .compatible = "qcom,apq8064", .data = &match_data_apq8064 }, { .compatible = "qcom,msm8974", .data = &match_data_krait }, - { .compatible = "qcom,msm8960", .data = &match_data_krait }, + { .compatible = "qcom,msm8960", .data = &match_data_apq8064 }, {}, }; MODULE_DEVICE_TABLE(of, qcom_cpufreq_match_list);