Received: by 2002:a25:4158:0:0:0:0:0 with SMTP id o85csp210081yba; Mon, 20 May 2019 07:27:44 -0700 (PDT) X-Google-Smtp-Source: APXvYqwALwjp5H+GqjEUAnGTfQTSu0yi1cJcFCDE9wv/QrOvJlBmfK/Zn5eUTIebus/brmE2am2g X-Received: by 2002:aa7:980e:: with SMTP id e14mr80850517pfl.142.1558362464623; Mon, 20 May 2019 07:27:44 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1558362464; cv=none; d=google.com; s=arc-20160816; b=zx3oy7y30tr5cWx6Lawgd7KnNVCXzFwLJF+tzXF3lRj1fee8HOvChQbXiKmWwkJY+S 8QlaIEm9M+4dnKut3nrpxXMvG4jlV6JiMeNQa3fLuRc+LdpIlqTE0GG7nCVhbUvEVvVZ dJ4CFHWg5aLGbXfBmvVrhQjhJRHapRj72K5QeQ/PacMdBmKo+92meS3Zkd9lLooecn4Q CUb3fjd4hrYpirRMgRbp7lVCCHAw6n6GD54QM4B67zVhHLuXk/EJBaiYmaHHsa8raIn+ DfWBxzndx7u5nyOvakH4JD4/0FtEorT0Dal3OAfZuAln05kd4WuqTiOfiyGlioWbxxbF slog== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:in-reply-to :content-disposition:mime-version:references:message-id:subject:cc :to:from:date:dkim-signature; bh=YW9HGM19uXsoCoTdRY5JIfYDHKn9S6uoZXsNTuG/dJI=; b=QUkod6QB/ToyYauSOHmVzjmuJwyx/LemB+4P2JFLkQS1IdGmTj+RU0BauZroQ0bbbD i+IOtXcqI6b+FfMOvFNiUnknY5Y9VkDI0HSdgTcapX+lFPIHA7oI9FIHmFoCy6eBIGj2 lcU+WWd1YbbBKSRc483HQzFd2eUFD2Qq6S6NsYtLA0QIibTNDh2qxUEJJlPgS6ngJ1m3 cl04axR++Apm8tCiW46u/rnbBT41FJYP0/KChIIiRmR0gLPAhs4bgKntZF2bAKALmtkx ybrTQrN4llUW8SFFvqNJBolfjcNKkP84ZzuFQFHeoUCrlbP8M49JWpjDiolDZbqi2/MK lN6A== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b="nwKyM/IE"; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id j12si18859153pgg.188.2019.05.20.07.27.28; Mon, 20 May 2019 07:27:44 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b="nwKyM/IE"; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1731468AbfETKvF (ORCPT + 99 others); Mon, 20 May 2019 06:51:05 -0400 Received: from mail-pl1-f193.google.com ([209.85.214.193]:45759 "EHLO mail-pl1-f193.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1730626AbfETKvE (ORCPT ); Mon, 20 May 2019 06:51:04 -0400 Received: by mail-pl1-f193.google.com with SMTP id a5so6522290pls.12 for ; Mon, 20 May 2019 03:51:04 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=date:from:to:cc:subject:message-id:references:mime-version :content-disposition:in-reply-to:user-agent; bh=YW9HGM19uXsoCoTdRY5JIfYDHKn9S6uoZXsNTuG/dJI=; b=nwKyM/IEfq5ctjmYY2jYx0QaToWYb1YEuO/QgxBA8FfWHLb8CsKObYDEvzR49aMFbv +oCYec9BmqEYalYo6wUQNHs7NdIb1s+BWbibEgPSe9CFiJGZ4EnF9Ze+cz3e34PXLu0Z Go6tkBaHkP6bJEkNUalms35nw8zGwJ2+hihxeooKztv5hmF4OIS+gPeX2oceCcAy+Q4u G6iAB3C7xRw07Jb/+F1MEC0tjWHjS29c2NSQhCOIEQcvF9TjNmzN/J2P5WzstB/HuOJz D6hwHrVl3td8rIgJIFKzxV/iAjMFTAiJo3fBbK2T9R78xEwU0jkt1bBYhv+P95sZ/cQ5 ueaA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:in-reply-to:user-agent; bh=YW9HGM19uXsoCoTdRY5JIfYDHKn9S6uoZXsNTuG/dJI=; b=d6vv3h3/imW4qZi8v4lu0moGUCg5Q4ics3q3+9Lk/zMYn9eluPMJiQb6juh3ER4X+s gcNQiXImUfOgQmMF/jnmcZkWR692UX9aClwqCYeMAV/eotfV2UjVbgmz47d/hP23yJ5b 3p7pzZNjh7vCKdeh1/qo5KjiFExn5XPYbwiuowajD0yjL3cJudL5vqCkHj7vNhdbzOmP yYvHEX9XoBXald797oGFUcGdLm227x6ztH/DTDAYQpLWBzKVwz+uGzyNupyxQKVKce28 j5vxZLx1zMrV5c+5vQ1K3k4sWTVmzRgllGOBKL1GmcDe5H8tVqmOjIQQ8q/fHKRWdOYV PMfg== X-Gm-Message-State: APjAAAVLTPKtSVk6VSOdvHuarDm1H4HqPDvaaSGmJ3oc1xF1v5EiYsWs w/T8QgoA1U9/ntyipChfrSgITQ== X-Received: by 2002:a17:902:b20f:: with SMTP id t15mr54482368plr.220.1558349463660; Mon, 20 May 2019 03:51:03 -0700 (PDT) Received: from localhost ([122.172.118.99]) by smtp.gmail.com with ESMTPSA id 63sm24202008pfu.95.2019.05.20.03.51.02 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 20 May 2019 03:51:02 -0700 (PDT) Date: Mon, 20 May 2019 16:21:00 +0530 From: Viresh Kumar To: Nicolas Saenz Julienne Cc: stefan.wahren@i2se.com, "Rafael J. Wysocki" , mbrugger@suse.de, sboyd@kernel.org, eric@anholt.net, f.fainelli@gmail.com, bcm-kernel-feedback-list@broadcom.com, ptesarik@suse.com, linux-rpi-kernel@lists.infradead.org, ssuloev@orpaltech.com, linux-clk@vger.kernel.org, linux-arm-kernel@lists.infradead.org, mturquette@baylibre.com, linux-pm@vger.kernel.org, linux-kernel@vger.kernel.org Subject: Re: [RFC v2 5/5] cpufreq: add driver for Raspbery Pi Message-ID: <20190520105100.hol6cmvnsf3exzes@vireshk-i7> References: <20190520104708.11980-1-nsaenzjulienne@suse.de> <20190520104708.11980-6-nsaenzjulienne@suse.de> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20190520104708.11980-6-nsaenzjulienne@suse.de> User-Agent: NeoMutt/20180716-391-311a52 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 20-05-19, 12:47, Nicolas Saenz Julienne wrote: > Raspberry Pi's firmware offers and interface though which update it's > performance requirements. It allows us to request for specific runtime > frequencies, which the firmware might or might not respect, depending on > the firmware configuration and thermals. > > As the maximum and minimum frequencies are configurable in the firmware > there is no way to know in advance their values. So the Raspberry Pi > cpufreq driver queries them, builds an opp frequency table to then > launch cpufreq-dt. > > Signed-off-by: Nicolas Saenz Julienne > --- > drivers/cpufreq/Kconfig.arm | 8 +++ > drivers/cpufreq/Makefile | 1 + > drivers/cpufreq/raspberrypi-cpufreq.c | 83 +++++++++++++++++++++++++++ > 3 files changed, 92 insertions(+) > create mode 100644 drivers/cpufreq/raspberrypi-cpufreq.c > > diff --git a/drivers/cpufreq/Kconfig.arm b/drivers/cpufreq/Kconfig.arm > index 179a1d302f48..f6eba7ae50d0 100644 > --- a/drivers/cpufreq/Kconfig.arm > +++ b/drivers/cpufreq/Kconfig.arm > @@ -308,3 +308,11 @@ config ARM_PXA2xx_CPUFREQ > This add the CPUFreq driver support for Intel PXA2xx SOCs. > > If in doubt, say N. > + > +config ARM_RASPBERRYPI_CPUFREQ > + tristate "Raspberry Pi cpufreq support" > + depends on RASPBERRYPI_FIRMWARE || COMPILE_TEST > + help > + This adds the CPUFreq driver for Raspberry Pi > + > + If in doubt, say N. > diff --git a/drivers/cpufreq/Makefile b/drivers/cpufreq/Makefile > index 689b26c6f949..02678e9b2ff5 100644 > --- a/drivers/cpufreq/Makefile > +++ b/drivers/cpufreq/Makefile > @@ -84,6 +84,7 @@ obj-$(CONFIG_ARM_TEGRA124_CPUFREQ) += tegra124-cpufreq.o > obj-$(CONFIG_ARM_TEGRA186_CPUFREQ) += tegra186-cpufreq.o > obj-$(CONFIG_ARM_TI_CPUFREQ) += ti-cpufreq.o > obj-$(CONFIG_ARM_VEXPRESS_SPC_CPUFREQ) += vexpress-spc-cpufreq.o > +obj-$(CONFIG_ARM_RASPBERRYPI_CPUFREQ) += raspberrypi-cpufreq.o My bad sorry, I noticed this earlier and forgot to comment. The above two files are maintained in alphabetical order, please add the entries at relevant places. > ################################################################################## > diff --git a/drivers/cpufreq/raspberrypi-cpufreq.c b/drivers/cpufreq/raspberrypi-cpufreq.c > new file mode 100644 > index 000000000000..a85988867d56 > --- /dev/null > +++ b/drivers/cpufreq/raspberrypi-cpufreq.c > @@ -0,0 +1,83 @@ > +// SPDX-License-Identifier: GPL-2.0 > +/* > + * Raspberry Pi cpufreq driver > + * > + * Copyright (C) 2019, Nicolas Saenz Julienne > + */ > + > +#include > +#include > +#include > +#include > +#include > +#include > +#include Would be better to keep above in alphabetical order as well. Please don't send another version now and wait for comments on the other patches. -- viresh