Received: by 2002:ac0:bc90:0:0:0:0:0 with SMTP id a16csp1604995img; Tue, 19 Mar 2019 11:15:30 -0700 (PDT) X-Google-Smtp-Source: APXvYqwXgQGj1LXneKFYkTXPiT60+5ag3yum/2sygsMeT8q2Vtl4VaSw5fSix5bd/Ed+KLh9Js/U X-Received: by 2002:a63:104e:: with SMTP id 14mr3038367pgq.185.1553019330337; Tue, 19 Mar 2019 11:15:30 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1553019330; cv=none; d=google.com; s=arc-20160816; b=qbEy9eP0w7im2vQU2ZQBpdtx1Xs7vqSaN6nAbmrKH9o+YhfuDKii4sYukG6CIlu1MF fE5TJqWFm/d8uFqhBHnfuuHgKNzkTORQJuprqi15FrtB021+8LHMFwt3s02w/oyWLZTB SzImhPTtylBr3CXU5hOOPJPNU/EPDDYEMTYfnvHpquHlwkxq48QYK9GY/It4x3UVRPfW mM9qV3snkJk7cQBMDD8eGF8b36D2bN4drCH23gjYhF0jmiAGgnslXl3Xhoxhw9Hyw4CR BG3yCV5JreTrE7obZEfXc5rXT7SMZIrk9iY5Uh67A+5g8dhJVEm7Xqs6nf8g9g8g5P2N 6qtw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :message-id:date:subject:cc:to:from; bh=s6PG+ee7m/kvkQIhs7yJsar5keNM0JtQ4//fJ2GqHmQ=; b=C6dACzWqBqw9zCmkncQG84K3c7cvHohSbjfhOXAcpx6Z63q4wC37HgIkJqU12jKDrR ElEVJgi5NfvS1W90uCyS7TChBv4jGhnPctCH8Z6kPrcAPhDLkkwjs1T8l7iE+vMskTfO jjXKbZiNItitINXQAfZRrvChCFnkGuSr86kxzEwqV4gONkICV0t5FB+DcINHAOWPGmVB 7hD6sT73Atyyf4jBlNM1BTwAVHbWLD1lbnnit84PEeNDrfLHqQ5orlIkjf2uWactgpvc ppUCERBzx66eeU5anGkVGkCUuSNRcYXCID+TsNBKymA1IRp9tV1nIp2Ij41xutgVR3rF wLVA== ARC-Authentication-Results: i=1; mx.google.com; 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=fail (p=NONE sp=NONE dis=NONE) header.from=collabora.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id x7si12405195plr.73.2019.03.19.11.15.15; Tue, 19 Mar 2019 11:15: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; Authentication-Results: mx.google.com; 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=fail (p=NONE sp=NONE dis=NONE) header.from=collabora.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727805AbfCSSNj (ORCPT + 99 others); Tue, 19 Mar 2019 14:13:39 -0400 Received: from bhuna.collabora.co.uk ([46.235.227.227]:38092 "EHLO bhuna.collabora.co.uk" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727418AbfCSSNj (ORCPT ); Tue, 19 Mar 2019 14:13:39 -0400 Received: from [127.0.0.1] (localhost [127.0.0.1]) (Authenticated sender: gportay) with ESMTPSA id 6C93A281416 From: =?UTF-8?q?Ga=C3=ABl=20PORTAY?= To: MyungJoo Ham , Kyungmin Park , Chanwoo Choi , Rob Herring , Heiko Stuebner , Enric Balletbo i Serra , Lin Huang , Brian Norris , Douglas Anderson , Klaus Goger , Derek Basehore , Randy Li , linux-pm@vger.kernel.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-rockchip@lists.infradead.org Cc: Mark Rutland , kernel@collabora.com, =?UTF-8?q?Ga=C3=ABl=20PORTAY?= Subject: [PATCH v2 0/5] Add support for drm/rockchip to dynamically control the DDR frequency. Date: Tue, 19 Mar 2019 14:13:18 -0400 Message-Id: <20190319181323.22804-1-gael.portay@collabora.com> X-Mailer: git-send-email 2.21.0 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Dear all, The rk3399 platform has a DFI controller that can monitor DDR load and a DMC driver that talks with the TF-A (Trusted Firmware-A) to dynamically set the DDR frequency with following flow. kernel Trusted Firmware-A (bl31) monitor ddr load | | get_target_rate | | pass rate to TF-A clk_set_rate(ddr) --------------------->run ddr dvs flow | | <------------------------------end ddr dvs flow | | return These patches add support for devfreq to dynamically control the DDR frequency into the drm rockchip driver. By default it uses the 'simple_ondemand' governor which can adjust the frequency based on the DDR load. Waiting for your feedback. Best regards, Gaƫl Changes in v2: - [PATCH 1/8] Really add Acked-by: Chanwoo Choi . - [PATCH 4/8] Removed from patchset. - [PATCH 5/8] Removed from patchset. - [PATCH 6/8] Removed from patchset. - [PATCH 7/8] Reword the commit message to reflect the removal of rk3390-dram-default-timing.dts in v1. - [PATCH 8/8] Move center-supply attribute of dmc node in file rk3399-gru-chromebook.dtsi (where ppvar_centerlogic is defined). Changes in v1: - [RFC 1/10] Add Acked-by: Chanwoo Choi - [RFC 1/10] s/Generic/General/ (Robin Murphy) - [RFC 2/10] Add reviewed and acked tags from Chanwoo Choi and Rob Herring - [RFC 3/10] Add an explanation for platform SIP calls. - [RFC 3/10] Change if statement for a switch. - [RFC 3/10] Rename ddr_flag to odt_enable to be more clear. - [RFC 4/10] Removed from the series. I did not found a use case where not holding the mutex causes the issue. - [RFC 7/10] Removed from the series. I did not found a use case where this matters. - [RFC 8/10] Move rk3399-dram.h to dt-includes. - [RFC 8/10] Put sdram default values under the dmc node. - [RFC 8/10] Removed rk3399-dram-default-timing.dts Enric Balletbo i Serra (3): devfreq: rockchip-dfi: Move GRF definitions to a common place. dt-bindings: devfreq: rk3399_dmc: Add rockchip,pmu phandle. devfreq: rk3399_dmc: Pass ODT and auto power down parameters to TF-A. Lin Huang (2): arm64: dts: rk3399: Add dfi and dmc nodes. arm64: dts: rockchip: Enable dmc and dfi nodes on gru. .../bindings/devfreq/rk3399_dmc.txt | 2 + .../dts/rockchip/rk3399-gru-chromebook.dtsi | 4 + arch/arm64/boot/dts/rockchip/rk3399-gru.dtsi | 20 +++++ .../boot/dts/rockchip/rk3399-op1-opp.dtsi | 29 ++++++++ arch/arm64/boot/dts/rockchip/rk3399.dtsi | 51 ++++++++++++- drivers/devfreq/event/rockchip-dfi.c | 23 ++---- drivers/devfreq/rk3399_dmc.c | 74 ++++++++++++++++++- include/dt-bindings/power/rk3399-dram.h | 73 ++++++++++++++++++ include/soc/rockchip/rk3399_grf.h | 21 ++++++ include/soc/rockchip/rockchip_sip.h | 1 + 10 files changed, 280 insertions(+), 18 deletions(-) create mode 100644 include/dt-bindings/power/rk3399-dram.h create mode 100644 include/soc/rockchip/rk3399_grf.h -- 2.21.0