Received: by 2002:a05:6a10:1287:0:0:0:0 with SMTP id d7csp6211461pxv; Thu, 29 Jul 2021 08:59:00 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwrlza3LFzd0xcmbAl8XDpxlG/9GRrqWFfSXKF1CGsCiJ3By4qw0bXo6iwoCtDrMfHgvBwF X-Received: by 2002:a17:906:b811:: with SMTP id dv17mr5206641ejb.444.1627574340655; Thu, 29 Jul 2021 08:59:00 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1627574340; cv=none; d=google.com; s=arc-20160816; b=uxe5wQAA8YtmmAFReVRET2P8lmgpNzJgpokZDm7U2BZ9QZYrQfZJY/VELJqGnG8/2o qBqH8VyZ9p3d73QWej/iBH/dgshP47+7uIRW5lYOm+es0iXAuJKnFWcn2anJS2hhG2YP +BbwYeAk9qMETK0EEEN42Ndx7PB9D2Sb5bla90EZXTYQ0CYeoftQssLXXf09XA/hXkc1 ZLEpOH6xqWFIfqFxjtwmMc5Y3XGAvcv97tAQWi5yL3FdAug3CfBq8H/wxT3o0EJs9IFh 9uUdQqvxSV+JWpCPqjU3VGCgud4oHX4Ef/Mh9OQSUBF1h/3FKPSGlBT8PvR2jtUXPQSN pEsg== 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; bh=KV1Mvfa5x6HzevU4WAVokHJXT32NTgG2EjR+3iFKw2Y=; b=cvyRDQO7KANxjdtWdvdAGYg5q/7eQQ6PdPN7SCm3SkAb6CiIzJ7tGoX7yDQCRAD4wc Cks4r9mD5GP5ytdtfeV4qK9ZcKNfuxrzh9UgrA1cSTua93UiGEZVdTCUpg4Yi411SvSY tB/aZ4/Q52dQh0XOVUG7TQamMc1sfkCQw8uTVUVkqp4RBpGjHLOGmG9dDsM5vZgSNvkS GFfY5xHJYu1nbja3KFwcYslujuBAbcXyxWvdN3+h/QIb8+uC543PKc6hWxpAJE73jLje QBMzGAFlHFgOH7ZW4kjHLwc8A6Emb4VWt57lgxu53rKa7IhTlt968jSxf6K66M/u814+ mONg== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id ew1si3188327ejb.614.2021.07.29.08.58.37; Thu, 29 Jul 2021 08:59:00 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S238157AbhG2P4r (ORCPT + 99 others); Thu, 29 Jul 2021 11:56:47 -0400 Received: from relay04.th.seeweb.it ([5.144.164.165]:59875 "EHLO relay04.th.seeweb.it" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S237891AbhG2P4f (ORCPT ); Thu, 29 Jul 2021 11:56:35 -0400 Received: from IcarusMOD.eternityproject.eu (unknown [2.237.20.237]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by m-r1.th.seeweb.it (Postfix) with ESMTPSA id 68E121F6AA; Thu, 29 Jul 2021 17:56:26 +0200 (CEST) From: AngeloGioacchino Del Regno To: bjorn.andersson@linaro.org Cc: agross@kernel.org, daniel.lezcano@linaro.org, rjw@rjwysocki.net, linux-kernel@vger.kernel.org, linux-pm@vger.kernel.org, linux-arm-msm@vger.kernel.org, phone-devel@vger.kernel.org, konrad.dybcio@somainline.org, marijn.suijten@somainline.org, martin.botka@somainline.org, jeffrey.l.hugo@gmail.com, jami.kettunen@somainline.org, ~postmarketos/upstreaming@lists.sr.ht, devicetree@vger.kernel.org, stephan@gerhold.net, robh@kernel.org, bartosz.dudziak@snejp.pl, AngeloGioacchino Del Regno Subject: [PATCH v8 0/5] Implement SPM/SAW for MSM8998 and SDM6xx Date: Thu, 29 Jul 2021 17:56:04 +0200 Message-Id: <20210729155609.608159-1-angelogioacchino.delregno@somainline.org> X-Mailer: git-send-email 2.32.0 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Changes in v8: - Rebased on next-20210728 - Fixed all YAML issues from dt_binding_check - Fixed forgotten signoffs (truly, truly sorry about that) Changes in v7: - Fixed functionality breakage on ARM for cpuidle-qcom-spm... now it works :)) - Reworded description of patch 1/5 Changes in v6: - Moved cpuidle_driver to be private to cpuidle-qcom-spm (unused in spm.c), now we are assigning the cpuidle_driver structure fields inside of the spm_cpuidle_register function; this also fixes the cpumask assignment issue from v5 - Fixed another contamination from 2/3 in 1/3 (argh!! :]) - Added dt-bindings documentation for the SPM driver Changes in v5: - Fixed contamination from patch 2/3 in patch 1/3 - Fixed missing bits in cpuidle-qcom-spm (thanks Stephan) Changes in v4: - Huge patch series has been split for better reviewability, as suggested by Bjorn Changes in v3: - Rebased (no changes - was in previous series' v3) Changes in v2: - Fixed MSM8998 SAW parameters on SPM driver Tested on the following smartphones: - Sony Xperia XA2 (SDM630) - Sony Xperia XA2 Ultra (SDM630) - Sony Xperia 10 (SDM630) - Sony Xperia XZ Premium (MSM8998) - F(x)Tec Pro 1 (MSM8998) This is a component that we can find on very old chips, like MSM8974; there, it has been used to actually do the power scaling basically "on its own" - sending the cores in a specific sleep mode to save power. On the newer ones, including MSM8998, SDM630, 660 and others, it is still present! Though, this time, it's being used for the cluster caches and it has a different firmware (and maybe it's also slightly different HW), implementing the SAWv4.1 set and getting controlled *not by the OS* but by other controllers in the SoC (like the OSM). Contrary from MSM8974 and the like, this new version of the SPM just requires us to set the initial parameters for AVS and *nothing else*, as its states will be totally managed internally. AngeloGioacchino Del Regno (5): cpuidle: qcom_spm: Detach state machine from main SPM handling dt-bindings: soc: qcom: Add devicetree binding for QCOM SPM soc: qcom: spm: Implement support for SAWv4.1, SDM630/660 L2 AVS soc: qcom: spm: Add compatible for MSM8998 SAWv4.1 L2 dt-bindings: soc: qcom: spm: Document SDM660 and MSM8998 compatibles .../bindings/soc/qcom/qcom,spm.yaml | 80 +++++ drivers/cpuidle/Kconfig.arm | 1 + drivers/cpuidle/cpuidle-qcom-spm.c | 318 ++++-------------- drivers/soc/qcom/Kconfig | 9 + drivers/soc/qcom/Makefile | 1 + drivers/soc/qcom/spm.c | 254 ++++++++++++++ include/soc/qcom/spm.h | 43 +++ 7 files changed, 456 insertions(+), 250 deletions(-) create mode 100644 Documentation/devicetree/bindings/soc/qcom/qcom,spm.yaml create mode 100644 drivers/soc/qcom/spm.c create mode 100644 include/soc/qcom/spm.h -- 2.32.0