Received: by 2002:a6b:500f:0:0:0:0:0 with SMTP id e15csp887545iob; Wed, 4 May 2022 09:58:53 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwimIytJPtOtUsZdByOdLV5JbMoFccVDn2Yg1Oua8TdXlw9LmdHYCCwrmYg2u6g1YKVuFAk X-Received: by 2002:a05:6402:1bce:b0:425:bfaf:f20c with SMTP id ch14-20020a0564021bce00b00425bfaff20cmr24159616edb.359.1651683533578; Wed, 04 May 2022 09:58:53 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1651683533; cv=none; d=google.com; s=arc-20160816; b=k/GY7zbo5uUn6Q6iP7BsfA3txO6IRwHS+zDDfMSi58Fkh5ydL2oAQEZuOV+EcZRqeK wMYqTojntGvsJ3F0vrksnx0siYPVHrBM8l7or4XH+P7GDAr+EypXkFLu2gjVDZnobhm3 OjRuPGfw6piEe5LQWC0yUxm30JDjGdEXOYSAWfsShn2z6uzKunpQ1i/M5CQnyX8jpFDL xycgLhlRHhVfbTQH73MeaMmJ5tD22f7oHkbeOUVvjsyq1rNkSZSaaPTDl0xXhUEdsV2U GpL/2ivgsrRaZQCg/VpH36CIBshT0657r+WzDrfdTMjjemhAP51+C5+LUB2eaz+Zext+ 6N7Q== 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=Pj0euMtw9DKwM2PtiqIbuioQyP79ROQbyeUvtMLCAOY=; b=lHz/QkjaQ/B59nbAQIrCkRORrb6sh9PiZy69qhYaQ1fcggKvKNuMJgdWT0z+XMYjeJ sREgPblI7KK8YOwhqe04+6gwjw/R7XiM4EE8Y8J9LO4gPU2p9gMeSWp29l9w1+tcioXS ID767bkO02o2LUb6qu6cj4DXCQ2jTgm5aVkvwFP9ypQtBZKxECYK/dCmKUisFQNNRSFH 8pT3Nud7z98we7JnBMc3UzwVXPzFeHl6Xf3SIV8HmxsjbRiz2veF7gwdGZobFPEiXOEE fL+rzeo0XY9PJOr2f4OY5e6LyNHLFgvT2J5V0brm8ZB5NqoTvFQI6sLjcjc7R5L8mrE0 t6aA== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=QUARANTINE dis=NONE) header.from=marcan.st Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id w11-20020a1709060a0b00b006f3f56d5ab6si12658969ejf.391.2022.05.04.09.58.29; Wed, 04 May 2022 09:58:53 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=QUARANTINE dis=NONE) header.from=marcan.st Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1345914AbiEDH4I (ORCPT + 99 others); Wed, 4 May 2022 03:56:08 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:56196 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1345869AbiEDHzq (ORCPT ); Wed, 4 May 2022 03:55:46 -0400 Received: from mail.marcansoft.com (marcansoft.com [212.63.210.85]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id A014A1AF02; Wed, 4 May 2022 00:52:06 -0700 (PDT) Received: from [127.0.0.1] (localhost [127.0.0.1]) (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: hector@marcansoft.com) by mail.marcansoft.com (Postfix) with ESMTPSA id E009741E64; Wed, 4 May 2022 07:52:00 +0000 (UTC) From: Hector Martin To: "Rafael J. Wysocki" , Viresh Kumar Cc: Hector Martin , Sven Peter , Alyssa Rosenzweig , Rob Herring , Krzysztof Kozlowski , Stephen Boyd , Ulf Hansson , Marc Zyngier , Mark Kettenis , linux-arm-kernel@lists.infradead.org, linux-pm@vger.kernel.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH v2 0/4] Apple SoC cpufreq driver Date: Wed, 4 May 2022 16:51:49 +0900 Message-Id: <20220504075153.185208-1-marcan@marcan.st> X-Mailer: git-send-email 2.35.1 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00,SPF_HELO_NONE, SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hi folks, Here's a second take on the cpufreq driver for Apple SoCs. This is a complete rewrite using a stand-alone cpufreq driver instead of using the cpufreq-dt infrastructure. Since v1 we ran some experiments on the memory controller performance switching and it turns out it doesn't make a huge difference, so it makes sense to punt that feature to the future (perhaps once a proper memory controller driver exists for other reasons, e.g. for error handling). One advantage of having a standalone cpufreq driver is that we can support fast switching. This also means any future interaction with the memory controller will probably use some bespoke mechanism instead of the genpd infrastructure, so we can keep the fast path without allowing sleeps/etc. The driver is based on scpi-cpufreq.c, with some bits (e.g. the apple,freq-domain stuff) inspired by how cpufreq-qcom-hw does it. I'm not sure if that particular property should be described in a binding, since it goes in the cpu nodes (qcom doesn't have it anywhere...). Changes since v1: - Complete rewrite - Reports current frequency to userspace properly (incl. if different from requested due to hardware constraints) - Supports fast switching - MCC latency control stuff no longer included, punted for later - Supports exposing higher states as turbo states Hector Martin (4): MAINTAINERS: Add entries for Apple SoC cpufreq driver dt-bindings: cpufreq: apple,soc-cpufreq: Add binding for Apple SoC cpufreq cpufreq: apple-soc: Add new driver to control Apple SoC CPU P-states arm64: dts: apple: Add CPU topology & cpufreq nodes for t8103 .../bindings/cpufreq/apple,soc-cpufreq.yaml | 121 +++++++ MAINTAINERS | 2 + arch/arm64/boot/dts/apple/t8103.dtsi | 203 ++++++++++- drivers/cpufreq/Kconfig.arm | 9 + drivers/cpufreq/Makefile | 1 + drivers/cpufreq/apple-soc-cpufreq.c | 330 ++++++++++++++++++ drivers/cpufreq/cpufreq-dt-platdev.c | 2 + 7 files changed, 658 insertions(+), 10 deletions(-) create mode 100644 Documentation/devicetree/bindings/cpufreq/apple,soc-cpufreq.yaml create mode 100644 drivers/cpufreq/apple-soc-cpufreq.c -- 2.35.1