From patchwork Thu Aug 10 12:52:18 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Linus Walleij X-Patchwork-Id: 109805 Delivered-To: patch@linaro.org Received: by 10.140.95.78 with SMTP id h72csp2313146qge; Thu, 10 Aug 2017 05:52:35 -0700 (PDT) X-Received: by 10.84.138.129 with SMTP id 1mr13395096plp.223.1502369555481; Thu, 10 Aug 2017 05:52:35 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1502369555; cv=none; d=google.com; s=arc-20160816; b=ZNtcdNxtqj9mSgIMQD5S7nYnaTTBII/CGWoquU4oFzsABSljz5HxOS4nGdNPOPU1+h 0nRTtH/xym6TOGEHzZ9JlFGYg93y41Iiab4P8JaRGrLj8oO2HfSVSvKQgyE75mkE8icN vem5ABAIP6WN7GH/0ftPr58XejYvDgX1Z+oacl2JaW27ckpM5XKjUFGg4hT1trFdWVSD sPL8PacG9bdCov+LR7sxNT/6rdZT1UmNuS7Bf2KYhHXcOywWzXqFYi0VR9LdZtOGSXy3 rZ2hwjWVyGU78ryaUxLtW8xl93AeYNToPCQhWtTWYBQ0Jh5L6WkPh+foRPmoohKFzQYi 5WFQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:references:in-reply-to:message-id:date :subject:cc:to:from:dkim-signature:arc-authentication-results; bh=1Ajz05yrfb8hAQ4+waiFrks150m3CGXE4R2+zqetv8M=; b=YRe4J3ZWXGcJ0TlyF4zHf/p9sPW5fYAVG+S3Qzwr2nIoNjXAULhLf44tAKVa0JvTZJ dcC+xSEZg1wgfKvzIamHV12rUdOm/1IjrvKB0hxDA+GbvEmF+pLQ2JCvOosjhz8vz5lB /WpOS/wJvQSFw9PFVDP93ku1Eyjg8xKLM7uXFv51A67RPyRyUp32H3sn8A8Nb7qqZAh1 orcv8Q8h4Bi6K9KhrWrgejFRb646sRX6yQ5uSFiXCwjmYFxF6ot1ZvAsOfInsQ6qd2zD CfZ1jqHn1zcypMJhSIXxDrS9IxhD8UBAgh5PhprGzvp4NGVgaAvdB3g5TA27s9M0WnH0 hO2Q== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=Yat/WH8Y; spf=pass (google.com: best guess record for domain of linux-pm-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-pm-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 k76si4147770pfh.174.2017.08.10.05.52.35; Thu, 10 Aug 2017 05:52:35 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-pm-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=Yat/WH8Y; spf=pass (google.com: best guess record for domain of linux-pm-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-pm-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 S1752109AbdHJMwe (ORCPT + 12 others); Thu, 10 Aug 2017 08:52:34 -0400 Received: from mail-lf0-f49.google.com ([209.85.215.49]:36547 "EHLO mail-lf0-f49.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751387AbdHJMwe (ORCPT ); Thu, 10 Aug 2017 08:52:34 -0400 Received: by mail-lf0-f49.google.com with SMTP id o85so3005476lff.3 for ; Thu, 10 Aug 2017 05:52:33 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=1Ajz05yrfb8hAQ4+waiFrks150m3CGXE4R2+zqetv8M=; b=Yat/WH8YmG5yi/3wfkn4VtWwfSxou2t4xIM24kG3Lwbzs2MIZ/T9lwsOAT/hJv9bUL xt0sBDAdc2Wxij6QK0ha5RGFGh912ekCYjcO/Pi1wNWLXsR5N0xVR64HAMnSUfIQsNyS ArrsGP0J5NvV5XdFNh3iFuFA3bcSaBUHQRizs= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=1Ajz05yrfb8hAQ4+waiFrks150m3CGXE4R2+zqetv8M=; b=dCZ1qOsdYsfSDgNZn+jAFPkRX+5HzSlkCrqDGUARuVRDzv+R3KjjGvFFtPq+eSjN8S XxyBBq6OUCFV3nxmNnxJn9QjNQYwXnCYQGatljyNvp0JYpjSWsiRfNmUBykBAgcXMb5z fYwpaoYaZ9rHTn789MZDa55GMabSjkk6g81UQcb8glxumWZCVM7EaWbuKmNiQ6AV07g4 pYxZDVSKFik6hdpXv3CpEqbnbwo6uu3t06RVQEbqOs9zB7Q8O5QaOPTPDYon+0L+S3vw Paw/AVdoaR1cLUTu38bdX69eEdjDiDaGAgEap9V6bMDSxFWw1Xv5shj5mnIF/XmMK78q CBgA== X-Gm-Message-State: AHYfb5jD+iwsg4+GJbUA0HJBEVqKEAgGgVQCfH6dDv+WDMAYY118FtYO TZaNdGe0R2KPm0HO X-Received: by 10.46.84.86 with SMTP id y22mr4009900ljd.135.1502369552670; Thu, 10 Aug 2017 05:52:32 -0700 (PDT) Received: from genomnajs.ideon.se ([85.235.10.227]) by smtp.gmail.com with ESMTPSA id 15sm726816ljw.35.2017.08.10.05.52.31 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 10 Aug 2017 05:52:31 -0700 (PDT) From: Linus Walleij To: "Rafael J . Wysocki" , Viresh Kumar , Lee Jones Cc: linux-pm@vger.kernel.org, linux-arm-kernel@lists.infradead.org, Arnd Bergmann , Ulf Hansson , Linus Walleij Subject: [PATCH 1/4] ARM: dts: augment Ux500 to use DT cpufreq Date: Thu, 10 Aug 2017 14:52:18 +0200 Message-Id: <20170810125221.25818-2-linus.walleij@linaro.org> X-Mailer: git-send-email 2.9.4 In-Reply-To: <20170810125221.25818-1-linus.walleij@linaro.org> References: <20170810125221.25818-1-linus.walleij@linaro.org> Sender: linux-pm-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-pm@vger.kernel.org This adds the operating points to the Ux500 device tree and deletes the old special-purpose cpufreq node, as we can now use the generic DT cpufreq driver. Signed-off-by: Linus Walleij --- Viresh et al: I will merge this into ARM SoC separately from the rest of the patches once we agree on this approach. --- arch/arm/boot/dts/ste-dbx5x0.dtsi | 15 ++++++++------- 1 file changed, 8 insertions(+), 7 deletions(-) -- 2.9.4 diff --git a/arch/arm/boot/dts/ste-dbx5x0.dtsi b/arch/arm/boot/dts/ste-dbx5x0.dtsi index 6c5affe2d0f5..2310a4e97768 100644 --- a/arch/arm/boot/dts/ste-dbx5x0.dtsi +++ b/arch/arm/boot/dts/ste-dbx5x0.dtsi @@ -37,6 +37,14 @@ device_type = "cpu"; compatible = "arm,cortex-a9"; reg = <0x300>; + /* cpufreq controls */ + operating-points = <998400 0 + 800000 0 + 400000 0 + 200000 0>; + clocks = <&prcmu_clk PRCMU_ARMSS>; + clock-names = "cpu"; + clock-latency = <20000>; }; CPU1: cpu@301 { device_type = "cpu"; @@ -494,13 +502,6 @@ reg = <0x80157450 0xC>; }; - cpufreq { - compatible = "stericsson,cpufreq-ux500"; - clocks = <&prcmu_clk PRCMU_ARMSS>; - clock-names = "armss"; - status = "disabled"; - }; - thermal@801573c0 { compatible = "stericsson,db8500-thermal"; reg = <0x801573c0 0x40>; From patchwork Thu Aug 10 12:52:19 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Linus Walleij X-Patchwork-Id: 109806 Delivered-To: patch@linaro.org Received: by 10.140.95.78 with SMTP id h72csp2313224qge; Thu, 10 Aug 2017 05:52:39 -0700 (PDT) X-Received: by 10.99.47.1 with SMTP id v1mr11165474pgv.306.1502369559454; Thu, 10 Aug 2017 05:52:39 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1502369559; cv=none; d=google.com; s=arc-20160816; b=Bxs6XcEOAIQJsGL4EPu7JMjxx89jO8NfAiWSJSL8J5O9gPgl8P9TYtpppZr9DRTvZ4 9+E9IZ57u1F4Cyu99U9wKIFrNmf18FNZ86UwJ7mtbIyjSinzQUd7eKKByX9gzMe9OWRT opycjy6jB75aNY6kWo+VmmrtqJDE6JjvBRKZPOF8jVg9jcyrKvek1EwHxlR73hGiEhmA hYaApih+SjIeZ9RiatYyIB6myAPJWvEyeHcU/IsDYn0qZ+boz/pRXK5YyQr4Oig4E9gA LuBP8osLaCGdtSUX0hEJOvfb3rBH8IsDQtBpuiKzpqGX3TMi2fo7/JxpC2v5s1bfVdZ+ sZ3A== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:references:in-reply-to:message-id:date :subject:cc:to:from:dkim-signature:arc-authentication-results; bh=FhwF6BdZxOOSy6r47DNtvvL66aM5joA6BFU6qegDXyk=; b=nznoIRl8wqTW5A14nQEPBPP8UkW30VzFTH5WujVRSJKaapg4clqWPzcISMlYPcADoY 3U9zgUgTYhek998b8PGK5IxidLk3HptPD5563gcMYhiKb7KMIecqU5keUyMJCaLcjLjy z/yFgpnh7KPRRGaQhHvLAUBm9e1a2t8yBdXhfZXDYFmdfCiqXkhctqHBYW25g1HrLHGO isy+GbxWxQDOjAK77Bn4g724svFax518v+ik2Zjw7jyxpzycL5QUVT/+nlCaluFZQrhn VO81GYRBcfQ+peepPGvF8QXtnxFgqpjlKC5zsDrojfYYhd21tMVaPjbtQW4pUsk2n9X/ A6hg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=PzthO22r; spf=pass (google.com: best guess record for domain of linux-pm-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-pm-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 k76si4147770pfh.174.2017.08.10.05.52.39; Thu, 10 Aug 2017 05:52:39 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-pm-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=PzthO22r; spf=pass (google.com: best guess record for domain of linux-pm-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-pm-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 S1752133AbdHJMwi (ORCPT + 12 others); Thu, 10 Aug 2017 08:52:38 -0400 Received: from mail-lf0-f50.google.com ([209.85.215.50]:34705 "EHLO mail-lf0-f50.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751387AbdHJMwi (ORCPT ); Thu, 10 Aug 2017 08:52:38 -0400 Received: by mail-lf0-f50.google.com with SMTP id g25so3072304lfh.1 for ; Thu, 10 Aug 2017 05:52:37 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=FhwF6BdZxOOSy6r47DNtvvL66aM5joA6BFU6qegDXyk=; b=PzthO22rgVPl9qlVOaP8LXM+QvpEj1tmmDficBfix25tltxzNVyIhqlFUhtZ6rcaoP H0il2ijakFNUivOD2UpgBXFUDjmCCSIeeSEwCmUR3ulLPbzBPYhEZXrR9CHgB56MRETd biFFDZUMzX6xx5sfjPixY8DsGOZhc+B2yuqFs= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=FhwF6BdZxOOSy6r47DNtvvL66aM5joA6BFU6qegDXyk=; b=kl7K7+SIfqakTJmWaTOkk0VtItM5frDmhiX1OLc9SVvIDAxnqDu5IAmGxaUbSncOmL HWC6GAIOLr6ZjBRiEiYT5HJZyA2ceZJiFSq6WQ6iQleT0zV6ifNYFm4USj2NRGMl5/+f NVZl9R/eVVBbtlglyoGWLAbQJoMpWkkhZNibDRLAuOUOou9AQecAaU36hXmYatvFLx1z 5D9QWZeHFI/8w1YvdTy5C7UFvTQ6aSwZ49JshupYw61NjAG3b1Bc82Evlj3XbR387viV LQWl/K7obc+x0dV1AJ9mtga+oT+KrSJA6Wfgw4QZkmZQ4rsLn3flORQrLwVd1NmCVJUU K3gg== X-Gm-Message-State: AHYfb5hlavuvtZgmGExtKnetkWrbS2BvtpqO22hHEDre9sYyKlR+nTsh 79nBvO7/uGix7MRs X-Received: by 10.46.83.81 with SMTP id t17mr4417248ljd.187.1502369556782; Thu, 10 Aug 2017 05:52:36 -0700 (PDT) Received: from genomnajs.ideon.se ([85.235.10.227]) by smtp.gmail.com with ESMTPSA id 15sm726816ljw.35.2017.08.10.05.52.35 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 10 Aug 2017 05:52:35 -0700 (PDT) From: Linus Walleij To: "Rafael J . Wysocki" , Viresh Kumar , Lee Jones Cc: linux-pm@vger.kernel.org, linux-arm-kernel@lists.infradead.org, Arnd Bergmann , Ulf Hansson , Linus Walleij Subject: [PATCH 2/4] cpufreq: enable the DT cpufreq driver on the Ux500 Date: Thu, 10 Aug 2017 14:52:19 +0200 Message-Id: <20170810125221.25818-3-linus.walleij@linaro.org> X-Mailer: git-send-email 2.9.4 In-Reply-To: <20170810125221.25818-1-linus.walleij@linaro.org> References: <20170810125221.25818-1-linus.walleij@linaro.org> Sender: linux-pm-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-pm@vger.kernel.org This enables the generic DT and OPP-based cpufreq driver on the ST-Ericsson Ux500 series. Signed-off-by: Linus Walleij --- drivers/cpufreq/cpufreq-dt-platdev.c | 5 +++++ 1 file changed, 5 insertions(+) -- 2.9.4 Acked-by: Viresh Kumar diff --git a/drivers/cpufreq/cpufreq-dt-platdev.c b/drivers/cpufreq/cpufreq-dt-platdev.c index 1c262923fe58..d80300251bc4 100644 --- a/drivers/cpufreq/cpufreq-dt-platdev.c +++ b/drivers/cpufreq/cpufreq-dt-platdev.c @@ -88,6 +88,11 @@ static const struct of_device_id machines[] __initconst = { { .compatible = "socionext,uniphier-ld11", }, { .compatible = "socionext,uniphier-ld20", }, + { .compatible = "st-ericsson,u8500", }, + { .compatible = "st-ericsson,u8540", }, + { .compatible = "st-ericsson,u9500", }, + { .compatible = "st-ericsson,u9540", }, + { .compatible = "ti,omap2", }, { .compatible = "ti,omap3", }, { .compatible = "ti,omap4", }, From patchwork Thu Aug 10 12:52:20 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Linus Walleij X-Patchwork-Id: 109807 Delivered-To: patch@linaro.org Received: by 10.140.95.78 with SMTP id h72csp2313346qge; Thu, 10 Aug 2017 05:52:45 -0700 (PDT) X-Received: by 10.99.112.16 with SMTP id l16mr11299913pgc.143.1502369565106; Thu, 10 Aug 2017 05:52:45 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1502369565; cv=none; d=google.com; s=arc-20160816; b=JeNOwBCR/1HZ/35WQNtlgFe5zXt/dQdStPmWMN/iJFMxE01ZXHxn91HYm6A1ytwtmI XwtqwTc0iloWXhHl9LId3dsoU7m6/5Yad8p8AoVQC1vqXbZEBKr0mIam2h98TdEtWBNR eekWdmNv+tvoIFlAvkE3b3X+XhLu0Ls+2pY8mtfxYFCH47tFthejDa1Tk+5Y4yI6AmVP c1GmmPq68eA/PoKE1sPaA7kES0Gqhlt2kTsweSPgHwBF0mG+r5DLw02HrR7feBxP9jDh BzwP3D1RI6C4wnMar1VE98Mx2yoydilmgPjJBbhHEbG/Y1EQyFUrUqCkAQztVqAND+jl BEBQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:references:in-reply-to:message-id:date :subject:cc:to:from:dkim-signature:arc-authentication-results; bh=Kv6r//6qwuJbfOthgfjdvX5mM0dhpw2dHa5SyeSxv/U=; b=za+bk43HVNDrWFQU79+Lg0vAkW+5hyBrEIxF9IHOK4xg9fMDz+/HDxPnGIZ5Df3CfZ VSUyDKx39B8PvT8KKIfHhXWgp4q0Okwed2S2YyXnfQJcMTk5B1QnaiWQDf/LxHKL3nCq LTtllBONYTfyEwAc40GUws+BPmVJGVts1jHwSADVEfzLRGOH01JjlEhcPQoJ0olLZL/0 jDlvMD6C1/Zx2qN4OKYxga52WVhjvMYiADWiKhPumdV8BGIhwfRjPftzGZNqvGJlrEbL iDsD9HcJqIgAtgjsK7nK6Y8p4apX525Jy4zbPkFl+aKMgpAiVniqlVvFRuuxgeHNljOW ex6g== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=Yg3XzuZE; spf=pass (google.com: best guess record for domain of linux-pm-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-pm-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 k76si4147770pfh.174.2017.08.10.05.52.44; Thu, 10 Aug 2017 05:52:45 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-pm-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=Yg3XzuZE; spf=pass (google.com: best guess record for domain of linux-pm-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-pm-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 S1752162AbdHJMwo (ORCPT + 12 others); Thu, 10 Aug 2017 08:52:44 -0400 Received: from mail-lf0-f52.google.com ([209.85.215.52]:34728 "EHLO mail-lf0-f52.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751387AbdHJMwn (ORCPT ); Thu, 10 Aug 2017 08:52:43 -0400 Received: by mail-lf0-f52.google.com with SMTP id g25so3073333lfh.1 for ; Thu, 10 Aug 2017 05:52:42 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=Kv6r//6qwuJbfOthgfjdvX5mM0dhpw2dHa5SyeSxv/U=; b=Yg3XzuZEO/cd952Vxz/Mr3A9GUHc9MCZ2CaL1hwC90405qyZd292EmGyKwD9ArnMMe oDPXiTQiCjhqheOxj8wiAAshi28AtKxQqQucGOe/47kzRwCYD6J3C0/GeMkTP9DJ/Dou MkoZPBG8J2yrib+dTmf1HQT7slqetRWZlPJ98= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=Kv6r//6qwuJbfOthgfjdvX5mM0dhpw2dHa5SyeSxv/U=; b=JKcTW/iTJYTSrOCEciTQeRPjr/vQsCCSVGRw4nTGnZGHsZtqdOME2IleU4cajvC11F sLDrj9noXRdZiFVpHvAb3Cn9MbQt+NAdCjzYq/ArueT7mDL1F4hjEDmJ7bA/KoAXDRSd ggT2O5vRJK//Je/MJWa+WnGcmANqA0M4nWAaMElVs570IjpNnnTKY73/XDCu0ooR5M7B 5m+kSjaVnO0I1pVHJby2ck9ILq4ht63eeMwJLSdmug122ocXigZgdQ79pVNbOl4Wrak/ t6/ahr661bsIxm6TbI55CbSQk6kAKyolXyDjL6QFjs9w7Io54mlfxoD3FNy6TlRj2gLO mPBA== X-Gm-Message-State: AHYfb5hFkCxBmrucfRwZWQ8oIX8UczZsjJvKkfwaTp+QDAb2dJiSl+Pf UqD1B/UyDt7ZwJr4 X-Received: by 10.46.22.13 with SMTP id w13mr4050717ljd.76.1502369562032; Thu, 10 Aug 2017 05:52:42 -0700 (PDT) Received: from genomnajs.ideon.se ([85.235.10.227]) by smtp.gmail.com with ESMTPSA id 15sm726816ljw.35.2017.08.10.05.52.40 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 10 Aug 2017 05:52:40 -0700 (PDT) From: Linus Walleij To: "Rafael J . Wysocki" , Viresh Kumar , Lee Jones Cc: linux-pm@vger.kernel.org, linux-arm-kernel@lists.infradead.org, Arnd Bergmann , Ulf Hansson , Linus Walleij Subject: [PATCH 3/4] mfd: db8500-prcmu: Get rid of cpufreq dependency Date: Thu, 10 Aug 2017 14:52:20 +0200 Message-Id: <20170810125221.25818-4-linus.walleij@linaro.org> X-Mailer: git-send-email 2.9.4 In-Reply-To: <20170810125221.25818-1-linus.walleij@linaro.org> References: <20170810125221.25818-1-linus.walleij@linaro.org> Sender: linux-pm-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-pm@vger.kernel.org The ARMSS clock, also known as the operating point of the CPU, should not cross-depend on cpufreq like this. Move the code to use just frequencies and remove the false frequency (1GHz) and put in the actual frequency provided by the ARMSS clock (998400000 Hz) as part of the process. After this and the related cpufreq patch, the DB8500 will simply use the standard DT cpufreq driver to change the operating points through the common clock framework using the ARMSS clock. Cc: Lee Jones Signed-off-by: Linus Walleij --- Lee, this needs to be merged together with the other related cpufreq patches, so an ACK to take this through the cpufreq subsystem would be appreciated once you're pleased with it. --- drivers/mfd/db8500-prcmu.c | 59 +++++++++++++--------------------------------- 1 file changed, 17 insertions(+), 42 deletions(-) -- 2.9.4 diff --git a/drivers/mfd/db8500-prcmu.c b/drivers/mfd/db8500-prcmu.c index 5c739ac752e8..a66be0203ece 100644 --- a/drivers/mfd/db8500-prcmu.c +++ b/drivers/mfd/db8500-prcmu.c @@ -33,7 +33,6 @@ #include #include #include -#include #include #include #include "dbx500-prcmu-regs.h" @@ -1692,32 +1691,22 @@ static long round_clock_rate(u8 clock, unsigned long rate) return rounded_rate; } -/* CPU FREQ table, may be changed due to if MAX_OPP is supported. */ -static struct cpufreq_frequency_table db8500_cpufreq_table[] = { - { .frequency = 200000, .driver_data = ARM_EXTCLK,}, - { .frequency = 400000, .driver_data = ARM_50_OPP,}, - { .frequency = 800000, .driver_data = ARM_100_OPP,}, - { .frequency = CPUFREQ_TABLE_END,}, /* To be used for MAX_OPP. */ - { .frequency = CPUFREQ_TABLE_END,}, -}; +static const unsigned long armss_freqs[] = { 200000000, 400000000, 800000000, 998400000 }; static long round_armss_rate(unsigned long rate) { - struct cpufreq_frequency_table *pos; - long freq = 0; - - /* cpufreq table frequencies is in KHz. */ - rate = rate / 1000; + unsigned long freq = 0; + int i; /* Find the corresponding arm opp from the cpufreq table. */ - cpufreq_for_each_entry(pos, db8500_cpufreq_table) { - freq = pos->frequency; - if (freq == rate) + for (i = 0; i < ARRAY_SIZE(armss_freqs); i++) { + freq = armss_freqs[i]; + if (rate <= freq) break; } /* Return the last valid value, even if a match was not found. */ - return freq * 1000; + return freq; } #define MIN_PLL_VCO_RATE 600000000ULL @@ -1854,21 +1843,23 @@ static void set_clock_rate(u8 clock, unsigned long rate) static int set_armss_rate(unsigned long rate) { - struct cpufreq_frequency_table *pos; - - /* cpufreq table frequencies is in KHz. */ - rate = rate / 1000; + unsigned long freq; + u8 opps[] = { ARM_EXTCLK, ARM_50_OPP, ARM_100_OPP, ARM_MAX_OPP }; + int i; /* Find the corresponding arm opp from the cpufreq table. */ - cpufreq_for_each_entry(pos, db8500_cpufreq_table) - if (pos->frequency == rate) + for (i = 0; i < ARRAY_SIZE(armss_freqs); i++) { + freq = armss_freqs[i]; + if (rate == freq) break; + } - if (pos->frequency != rate) + if (rate != freq) return -EINVAL; /* Set the new arm opp. */ - return db8500_prcmu_set_arm_opp(pos->driver_data); + pr_debug("SET ARM OPP 0x%02x\n", opps[i]); + return db8500_prcmu_set_arm_opp(opps[i]); } static int set_plldsi_rate(unsigned long rate) @@ -3049,12 +3040,6 @@ static const struct mfd_cell db8500_prcmu_devs[] = { .pdata_size = sizeof(db8500_regulators), }, { - .name = "cpufreq-ux500", - .of_compatible = "stericsson,cpufreq-ux500", - .platform_data = &db8500_cpufreq_table, - .pdata_size = sizeof(db8500_cpufreq_table), - }, - { .name = "cpuidle-dbx500", .of_compatible = "stericsson,cpuidle-dbx500", }, @@ -3067,14 +3052,6 @@ static const struct mfd_cell db8500_prcmu_devs[] = { }, }; -static void db8500_prcmu_update_cpufreq(void) -{ - if (prcmu_has_arm_maxopp()) { - db8500_cpufreq_table[3].frequency = 1000000; - db8500_cpufreq_table[3].driver_data = ARM_MAX_OPP; - } -} - static int db8500_prcmu_register_ab8500(struct device *parent) { struct device_node *np; @@ -3160,8 +3137,6 @@ static int db8500_prcmu_probe(struct platform_device *pdev) prcmu_config_esram0_deep_sleep(ESRAM0_DEEP_SLEEP_STATE_RET); - db8500_prcmu_update_cpufreq(); - err = mfd_add_devices(&pdev->dev, 0, common_prcmu_devs, ARRAY_SIZE(common_prcmu_devs), NULL, 0, db8500_irq_domain); if (err) { From patchwork Thu Aug 10 12:52:21 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Linus Walleij X-Patchwork-Id: 109808 Delivered-To: patch@linaro.org Received: by 10.140.95.78 with SMTP id h72csp2313443qge; Thu, 10 Aug 2017 05:52:49 -0700 (PDT) X-Received: by 10.98.150.75 with SMTP id c72mr11909948pfe.58.1502369569593; Thu, 10 Aug 2017 05:52:49 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1502369569; cv=none; d=google.com; s=arc-20160816; b=a1Uv194S0uzyslLaEI1S1ryWE4EYNiVk2RlScfatPkJGy8x3DXB0rYufS24bKIe02a lBKK/5hgy3yaGgbD2z6AwaxgZKgBjJoDZY5q6UP+eGiosNjm3e6fn+Cn4hXprcG5ppre IAsdu0MzcPnU5L3t6G1jjb+DQiRVsLSVkzmzYVjLsg28AqypFUtv/hF6r9pB4ctFoMXq BaaaC1T1zI+z2E7f58wmfNkS2HlWDBa+M9iwDJUSegGwA6gxgBV5Ee43nr9iyX1dNDdl kzHNqbiu+Uf1oW9KUsO1BPafSSZS9H9FjKugCq+hEouC3CsHdxh8efuZ7c1M6jMYDlt9 MRrA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:references:in-reply-to:message-id:date :subject:cc:to:from:dkim-signature:arc-authentication-results; bh=bEm1KlTPO4ntR5bTtmuVocY/ZlJ/sb7gzNy4VezX/AI=; b=TCyEnejRh5TFTtyLQW3BJVrIDD28yFTFYm0zrE+u9QZ50K2A7MIgtAKtpDUQYIYfgU ZFLJbQXbM/DIxE54hGgqyKts3/4GjSjYhdq6aC8tpwCCKM62KRasnWtnaAwOsoYlZxKf HsVGRRgj2UgwJkYcAruutGpLLmBHqsi7vkbuWRgRVtwtfwOiD/29tr8gQZoOiRTFXODW DP2pyMnY4GsJeaM18F6JEWFyMnIVc7NXzuDlpH7VXduXEsklTNPV88PX2vQc0D0oU2HO UqTIsAaFB1iVErhVH0MUrCKha8wpr2meHQxL9RHDcL9Z0Ki34Djkt8kp7zZ9XTjuwxtj bDvw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=ieYvf6Lw; spf=pass (google.com: best guess record for domain of linux-pm-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-pm-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 k76si4147770pfh.174.2017.08.10.05.52.49; Thu, 10 Aug 2017 05:52:49 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-pm-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=ieYvf6Lw; spf=pass (google.com: best guess record for domain of linux-pm-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-pm-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 S1751440AbdHJMws (ORCPT + 12 others); Thu, 10 Aug 2017 08:52:48 -0400 Received: from mail-lf0-f52.google.com ([209.85.215.52]:36608 "EHLO mail-lf0-f52.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751387AbdHJMwr (ORCPT ); Thu, 10 Aug 2017 08:52:47 -0400 Received: by mail-lf0-f52.google.com with SMTP id o85so3008103lff.3 for ; Thu, 10 Aug 2017 05:52:47 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=bEm1KlTPO4ntR5bTtmuVocY/ZlJ/sb7gzNy4VezX/AI=; b=ieYvf6LwV4BW96UVZ1z1qbEhBBQqQQ8QqF+pVoAzAShOmbeZwsL1D7Qn2ILe0x06RZ gVRVM40sVO90Ocr0Nl/MoTH2c99rgyOkbrJC0IWF81BIJ3rZlqgcsiL3JjQGWe+KkEwG scBFXeatbVZIU09xRxkVICz6K7peUzMkTlMg4= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=bEm1KlTPO4ntR5bTtmuVocY/ZlJ/sb7gzNy4VezX/AI=; b=LXL3E/7frZNpAlW105HmBwBq7jWlMUR3wgTAWdgxmYYk8ZRpLm9AqswxrahqHEAF4v /VZ59KslWUVMC95H1TDow8lLxnse8c9/EjkZpaudrP8MqG/VPW//b9S2k70eBmaKJxD6 OVXKV1dQn2hxUsgSYoc/hVaDYqlfyp2rAMVZSSjE48v3CUL9Uhha+/Ekl7V/7kWspCxf 51c9nXI8RcNgo2yaKphF9lqlUJYOKxd7K9pftT252xrJY89fEzEg7AEptOOFiI3A4UkU vReSlEMMfgSBQ/GHY3e5A4GC4z7riKDgamotYCX4aeGo2bFSqK/dERoHKbosupr8z7hO URtg== X-Gm-Message-State: AHYfb5gaA3byoiIqQW8N7nLLTojexVqij2izQfS1vDHshAhIhn+Oe2ec Wk5upOIkkwLj7qt4 X-Received: by 10.25.76.3 with SMTP id z3mr4664506lfa.27.1502369565501; Thu, 10 Aug 2017 05:52:45 -0700 (PDT) Received: from genomnajs.ideon.se ([85.235.10.227]) by smtp.gmail.com with ESMTPSA id 15sm726816ljw.35.2017.08.10.05.52.43 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 10 Aug 2017 05:52:44 -0700 (PDT) From: Linus Walleij To: "Rafael J . Wysocki" , Viresh Kumar , Lee Jones Cc: linux-pm@vger.kernel.org, linux-arm-kernel@lists.infradead.org, Arnd Bergmann , Ulf Hansson , Linus Walleij Subject: [PATCH 4/4] cpufreq: dbx500: Delete obsolete driver Date: Thu, 10 Aug 2017 14:52:21 +0200 Message-Id: <20170810125221.25818-5-linus.walleij@linaro.org> X-Mailer: git-send-email 2.9.4 In-Reply-To: <20170810125221.25818-1-linus.walleij@linaro.org> References: <20170810125221.25818-1-linus.walleij@linaro.org> Sender: linux-pm-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-pm@vger.kernel.org We have moved the Ux500 over to use the generic DT based cpufreq driver, so delete the old custom driver. At the same time select CPUFREQ_DT from the machine's Kconfig in order to satisfy the "default ARCH_U8500" selection on the old driver. Signed-off-by: Linus Walleij --- arch/arm/mach-ux500/Kconfig | 1 + drivers/cpufreq/Kconfig.arm | 9 ---- drivers/cpufreq/Makefile | 1 - drivers/cpufreq/dbx500-cpufreq.c | 103 --------------------------------------- 4 files changed, 1 insertion(+), 113 deletions(-) delete mode 100644 drivers/cpufreq/dbx500-cpufreq.c -- 2.9.4 Acked-by: Viresh Kumar diff --git a/arch/arm/mach-ux500/Kconfig b/arch/arm/mach-ux500/Kconfig index 4740ac393297..2b56e4af5a27 100644 --- a/arch/arm/mach-ux500/Kconfig +++ b/arch/arm/mach-ux500/Kconfig @@ -9,6 +9,7 @@ menuconfig ARCH_U8500 select ARM_GIC select CACHE_L2X0 select CLKSRC_NOMADIK_MTU + select CPUFREQ_DT select GPIOLIB select HAVE_ARM_SCU if SMP select HAVE_ARM_TWD if SMP diff --git a/drivers/cpufreq/Kconfig.arm b/drivers/cpufreq/Kconfig.arm index 2011fec2d6ad..74ed7e9a7f27 100644 --- a/drivers/cpufreq/Kconfig.arm +++ b/drivers/cpufreq/Kconfig.arm @@ -71,15 +71,6 @@ config ARM_HIGHBANK_CPUFREQ If in doubt, say N. -config ARM_DB8500_CPUFREQ - tristate "ST-Ericsson DB8500 cpufreq" if COMPILE_TEST && !ARCH_U8500 - default ARCH_U8500 - depends on HAS_IOMEM - depends on !CPU_THERMAL || THERMAL - help - This adds the CPUFreq driver for ST-Ericsson Ux500 (DB8500) SoC - series. - config ARM_IMX6Q_CPUFREQ tristate "Freescale i.MX6 cpufreq support" depends on ARCH_MXC diff --git a/drivers/cpufreq/Makefile b/drivers/cpufreq/Makefile index ab3a42cd29ef..a07c6efe4910 100644 --- a/drivers/cpufreq/Makefile +++ b/drivers/cpufreq/Makefile @@ -53,7 +53,6 @@ obj-$(CONFIG_ARM_DT_BL_CPUFREQ) += arm_big_little_dt.o obj-$(CONFIG_ARM_BRCMSTB_AVS_CPUFREQ) += brcmstb-avs-cpufreq.o obj-$(CONFIG_ARCH_DAVINCI) += davinci-cpufreq.o -obj-$(CONFIG_ARM_DB8500_CPUFREQ) += dbx500-cpufreq.o obj-$(CONFIG_ARM_EXYNOS5440_CPUFREQ) += exynos5440-cpufreq.o obj-$(CONFIG_ARM_HIGHBANK_CPUFREQ) += highbank-cpufreq.o obj-$(CONFIG_ARM_IMX6Q_CPUFREQ) += imx6q-cpufreq.o diff --git a/drivers/cpufreq/dbx500-cpufreq.c b/drivers/cpufreq/dbx500-cpufreq.c deleted file mode 100644 index 4ee0431579c1..000000000000 --- a/drivers/cpufreq/dbx500-cpufreq.c +++ /dev/null @@ -1,103 +0,0 @@ -/* - * Copyright (C) STMicroelectronics 2009 - * Copyright (C) ST-Ericsson SA 2010-2012 - * - * License Terms: GNU General Public License v2 - * Author: Sundar Iyer - * Author: Martin Persson - * Author: Jonas Aaberg - */ - -#include -#include -#include -#include -#include -#include -#include -#include - -static struct cpufreq_frequency_table *freq_table; -static struct clk *armss_clk; -static struct thermal_cooling_device *cdev; - -static int dbx500_cpufreq_target(struct cpufreq_policy *policy, - unsigned int index) -{ - /* update armss clk frequency */ - return clk_set_rate(armss_clk, freq_table[index].frequency * 1000); -} - -static int dbx500_cpufreq_init(struct cpufreq_policy *policy) -{ - policy->clk = armss_clk; - return cpufreq_generic_init(policy, freq_table, 20 * 1000); -} - -static int dbx500_cpufreq_exit(struct cpufreq_policy *policy) -{ - if (!IS_ERR(cdev)) - cpufreq_cooling_unregister(cdev); - return 0; -} - -static void dbx500_cpufreq_ready(struct cpufreq_policy *policy) -{ - cdev = cpufreq_cooling_register(policy); - if (IS_ERR(cdev)) - pr_err("Failed to register cooling device %ld\n", PTR_ERR(cdev)); - else - pr_info("Cooling device registered: %s\n", cdev->type); -} - -static struct cpufreq_driver dbx500_cpufreq_driver = { - .flags = CPUFREQ_STICKY | CPUFREQ_CONST_LOOPS | - CPUFREQ_NEED_INITIAL_FREQ_CHECK, - .verify = cpufreq_generic_frequency_table_verify, - .target_index = dbx500_cpufreq_target, - .get = cpufreq_generic_get, - .init = dbx500_cpufreq_init, - .exit = dbx500_cpufreq_exit, - .ready = dbx500_cpufreq_ready, - .name = "DBX500", - .attr = cpufreq_generic_attr, -}; - -static int dbx500_cpufreq_probe(struct platform_device *pdev) -{ - struct cpufreq_frequency_table *pos; - - freq_table = dev_get_platdata(&pdev->dev); - if (!freq_table) { - pr_err("dbx500-cpufreq: Failed to fetch cpufreq table\n"); - return -ENODEV; - } - - armss_clk = clk_get(&pdev->dev, "armss"); - if (IS_ERR(armss_clk)) { - pr_err("dbx500-cpufreq: Failed to get armss clk\n"); - return PTR_ERR(armss_clk); - } - - pr_info("dbx500-cpufreq: Available frequencies:\n"); - cpufreq_for_each_entry(pos, freq_table) - pr_info(" %d Mhz\n", pos->frequency / 1000); - - return cpufreq_register_driver(&dbx500_cpufreq_driver); -} - -static struct platform_driver dbx500_cpufreq_plat_driver = { - .driver = { - .name = "cpufreq-ux500", - }, - .probe = dbx500_cpufreq_probe, -}; - -static int __init dbx500_cpufreq_register(void) -{ - return platform_driver_register(&dbx500_cpufreq_plat_driver); -} -device_initcall(dbx500_cpufreq_register); - -MODULE_LICENSE("GPL v2"); -MODULE_DESCRIPTION("cpufreq driver for DBX500");