From patchwork Tue Mar 11 22:40:52 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Daniel Lezcano X-Patchwork-Id: 26059 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-qa0-f71.google.com (mail-qa0-f71.google.com [209.85.216.71]) by ip-10-151-82-157.ec2.internal (Postfix) with ESMTPS id 5A86F20068 for ; Tue, 11 Mar 2014 22:42:32 +0000 (UTC) Received: by mail-qa0-f71.google.com with SMTP id j7sf10026971qaq.10 for ; Tue, 11 Mar 2014 15:42:32 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:delivered-to:from:to:cc:subject :date:message-id:in-reply-to:references:sender:precedence:list-id :x-original-sender:x-original-authentication-results:mailing-list :list-post:list-help:list-archive:list-unsubscribe; bh=lb63zj+hUblA8zk8Ce/xaaswFbdnI7RtYl0At9tXlNI=; b=VPkz+4eVR8hnpYofmTaXfto0/qO+WVdj7TBVtgKQMYSdAcjzq897n2N1H97FfBCNIi bIrMe/W7hQgt5gRPIW0aZ63DhVWtBESWKcZw9xw1hDDuRZQmqxpuyuJrbUzACCaCqq9g eH3kzMH5BC3MuNHjKb2cwWTl8WbJHiAxJt8zUokYUIqfFT6+zBR7mgs4BA+SqNmIInHx eS4Q37Z2QACa0N+ktzMuGkaAFnje0sVPIWeC+ap2b9e9cM8WYaNdg+xizDIuuZmty9C3 nI04VoWl5k6FKn6C5QfZ6HfYqDHcPXh/KXqWEWXsDAaDxdVOIqob+GLGUjWTjUwQVCP8 td3A== X-Gm-Message-State: ALoCoQmtWZbzmG1U+lAfCFg11N7iYtpaYwaOqoC/7VTH4l3Z/w98o8araGq2PMC2w/4U5xMVZmke X-Received: by 10.236.25.175 with SMTP id z35mr6520280yhz.32.1394577752123; Tue, 11 Mar 2014 15:42:32 -0700 (PDT) MIME-Version: 1.0 X-BeenThere: patchwork-forward@linaro.org Received: by 10.140.109.9 with SMTP id k9ls2758424qgf.78.gmail; Tue, 11 Mar 2014 15:42:32 -0700 (PDT) X-Received: by 10.52.81.66 with SMTP id y2mr28322840vdx.23.1394577752014; Tue, 11 Mar 2014 15:42:32 -0700 (PDT) Received: from mail-vc0-f170.google.com (mail-vc0-f170.google.com [209.85.220.170]) by mx.google.com with ESMTPS id nc1si6236520vec.100.2014.03.11.15.42.31 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Tue, 11 Mar 2014 15:42:32 -0700 (PDT) Received-SPF: neutral (google.com: 209.85.220.170 is neither permitted nor denied by best guess record for domain of patch+caf_=patchwork-forward=linaro.org@linaro.org) client-ip=209.85.220.170; Received: by mail-vc0-f170.google.com with SMTP id hu8so9481291vcb.29 for ; Tue, 11 Mar 2014 15:42:31 -0700 (PDT) X-Received: by 10.58.38.166 with SMTP id h6mr8370132vek.22.1394577751921; Tue, 11 Mar 2014 15:42:31 -0700 (PDT) X-Forwarded-To: patchwork-forward@linaro.org X-Forwarded-For: patch@linaro.org patchwork-forward@linaro.org Delivered-To: patch@linaro.org Received: by 10.220.78.9 with SMTP id i9csp238870vck; Tue, 11 Mar 2014 15:42:31 -0700 (PDT) X-Received: by 10.67.13.226 with SMTP id fb2mr761321pad.146.1394577750974; Tue, 11 Mar 2014 15:42:30 -0700 (PDT) Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id zo6si339734pbc.343.2014.03.11.15.42.30; Tue, 11 Mar 2014 15:42:30 -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; Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1756165AbaCKWmV (ORCPT + 26 others); Tue, 11 Mar 2014 18:42:21 -0400 Received: from mail-we0-f172.google.com ([74.125.82.172]:44437 "EHLO mail-we0-f172.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1755946AbaCKWlR (ORCPT ); Tue, 11 Mar 2014 18:41:17 -0400 Received: by mail-we0-f172.google.com with SMTP id t61so10738264wes.31 for ; Tue, 11 Mar 2014 15:41:15 -0700 (PDT) X-Received: by 10.194.90.196 with SMTP id by4mr10171224wjb.45.1394577675796; Tue, 11 Mar 2014 15:41:15 -0700 (PDT) Received: from localhost.localdomain (AToulouse-654-1-526-136.w109-220.abo.wanadoo.fr. [109.220.245.136]) by mx.google.com with ESMTPSA id n3sm10411631wix.10.2014.03.11.15.41.14 for (version=TLSv1.1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Tue, 11 Mar 2014 15:41:15 -0700 (PDT) From: Daniel Lezcano To: tglx@linutronix.de, mingo@kernel.org Cc: linux-kernel@vger.kernel.org, dan.carpenter@oracle.com, ezequiel.garcia@free-electrons.com, ivan.khoronzhuk@ti.com, linus.walleij@linaro.org, magnus.damm@gmail.com, matthias.bgg@gmail.com, soren.brinkmann@xilinx.com, sboyd@codeaurora.org Subject: [PATCH 16/17] arm: zynq: Add support for cpufreq Date: Tue, 11 Mar 2014 23:40:52 +0100 Message-Id: <1394577653-8615-16-git-send-email-daniel.lezcano@linaro.org> X-Mailer: git-send-email 1.7.9.5 In-Reply-To: <1394577653-8615-1-git-send-email-daniel.lezcano@linaro.org> References: <531F8FAC.2040902@linaro.org> <1394577653-8615-1-git-send-email-daniel.lezcano@linaro.org> Sender: linux-kernel-owner@vger.kernel.org Precedence: list List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-Removed-Original-Auth: Dkim didn't pass. X-Original-Sender: daniel.lezcano@linaro.org X-Original-Authentication-Results: mx.google.com; spf=neutral (google.com: 209.85.220.170 is neither permitted nor denied by best guess record for domain of patch+caf_=patchwork-forward=linaro.org@linaro.org) smtp.mail=patch+caf_=patchwork-forward=linaro.org@linaro.org Mailing-list: list patchwork-forward@linaro.org; contact patchwork-forward+owners@linaro.org X-Google-Group-Id: 836684582541 List-Post: , List-Help: , List-Archive: List-Unsubscribe: , From: Soren Brinkmann The generic cpufreq-cpu0 driver can scale the CPU frequency on Zynq SOCs. Add the required platform device to the BSP and appropriate OPPs to the dts. Cc: Rob Herring Cc: Pawel Moll Cc: Mark Rutland Cc: Ian Campbell Cc: Kumar Gala Cc: Russell King Cc: devicetree@vger.kernel.org Signed-off-by: Soren Brinkmann Signed-off-by: Daniel Lezcano Acked-by: Michal Simek --- arch/arm/boot/dts/zynq-7000.dtsi | 6 ++++++ arch/arm/mach-zynq/Kconfig | 2 ++ arch/arm/mach-zynq/common.c | 3 +++ 3 files changed, 11 insertions(+) diff --git a/arch/arm/boot/dts/zynq-7000.dtsi b/arch/arm/boot/dts/zynq-7000.dtsi index 8b67b19..789d0ba 100644 --- a/arch/arm/boot/dts/zynq-7000.dtsi +++ b/arch/arm/boot/dts/zynq-7000.dtsi @@ -24,6 +24,12 @@ device_type = "cpu"; reg = <0>; clocks = <&clkc 3>; + operating-points = < + /* kHz uV */ + 666667 1000000 + 333334 1000000 + 222223 1000000 + >; }; cpu@1 { diff --git a/arch/arm/mach-zynq/Kconfig b/arch/arm/mach-zynq/Kconfig index f84fab1..f03e75b 100644 --- a/arch/arm/mach-zynq/Kconfig +++ b/arch/arm/mach-zynq/Kconfig @@ -2,6 +2,8 @@ config ARCH_ZYNQ bool "Xilinx Zynq ARM Cortex A9 Platform" if ARCH_MULTI_V7 select ARM_AMBA select ARM_GIC + select ARCH_HAS_CPUFREQ + select ARCH_HAS_OPP select COMMON_CLK select CPU_V7 select GENERIC_CLOCKEVENTS diff --git a/arch/arm/mach-zynq/common.c b/arch/arm/mach-zynq/common.c index 1db2a5ca..6444681 100644 --- a/arch/arm/mach-zynq/common.c +++ b/arch/arm/mach-zynq/common.c @@ -51,6 +51,8 @@ static struct platform_device zynq_cpuidle_device = { */ static void __init zynq_init_machine(void) { + struct platform_device_info devinfo = { .name = "cpufreq-cpu0", }; + /* * 64KB way size, 8-way associativity, parity disabled */ @@ -59,6 +61,7 @@ static void __init zynq_init_machine(void) of_platform_populate(NULL, of_default_bus_match_table, NULL, NULL); platform_device_register(&zynq_cpuidle_device); + platform_device_register_full(&devinfo); } static void __init zynq_timer_init(void)