Received: by 2002:a25:4158:0:0:0:0:0 with SMTP id o85csp970360yba; Fri, 26 Apr 2019 11:47:10 -0700 (PDT) X-Google-Smtp-Source: APXvYqzTiAK4weevPbRHkRus4YHU3hJUnNyG0Rsx61eKRz9UGDI/06fKzOrOM6ojgGD0gtFhZfgD X-Received: by 2002:a63:c54d:: with SMTP id g13mr42405114pgd.376.1556304430093; Fri, 26 Apr 2019 11:47:10 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1556304430; cv=none; d=google.com; s=arc-20160816; b=ciI1CdcRhB1+ij5+UoSLXPo3djLsKGs52VGpfHOvaHU4vQ3PHGiSHEvkhqMM6XOzcn 50RLm/dj5gRilok8NpQpusy+9dDmF52cu+aWGAraH2FlM6pu2eJkhmdlY/JHafvEtsN1 DpNABjVXKO1z6J5I0jYnumWCZ4Ce/YYBuG4rsXpxYUAeTCr2CEcXZSUfjZmQuqlqcbXp XpJBtVwhgYIzi9v4voXW5iGEH7UmCT1KfZ7yRV5xRMpOI9QDdA5EN3AcMULYC5JzWfFK dz4gaeJNFUEaD44U+grjaG8uSg46dEdW7UiGM5AAZGWg35jas12vwhNc7/fUyt9yjtWv MpHQ== 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-transfer-encoding:content-disposition:mime-version :references:message-id:subject:cc:to:from:date; bh=pEPusRheoqG6L8hFDZ+UpNai2za15r7H5JF7WhwGE5Y=; b=fpmHk1+MfaqUBQDV38UudrpzGFrVcL099Mo//AtNimaCJRW6CQymLH0RKpmzzxUEP3 JLeWJjYhFEFk25Kds0nOs1l4kSg9y+sm6qu1olN0ISO6Hy3cRRY1uz+n0nq2ASTKdPL8 8+R19WGjLUA9OB9dWxuolL6usE25T3D/uAtSAz8UMvhZ7c6NrQ4y8gQeGOBZ0NmCIwfE OoXkSRcPw39lWiGUQ6dVI6Ar0l0UIueCo9vuqWPlJvmNGkmerTSUewZyn8F2g3arxOcq Y9VL+YHYKsJT3XzbqUa4MkSngnnLR/Iaulg0l0iv1HNcNer++Z2IYM9oqcCcCtiuq5f2 fVMg== 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=kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id q4si26486063pfb.264.2019.04.26.11.46.53; Fri, 26 Apr 2019 11:47:10 -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=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726255AbfDZSqC (ORCPT + 99 others); Fri, 26 Apr 2019 14:46:02 -0400 Received: from mail-ot1-f66.google.com ([209.85.210.66]:33672 "EHLO mail-ot1-f66.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726049AbfDZSqC (ORCPT ); Fri, 26 Apr 2019 14:46:02 -0400 Received: by mail-ot1-f66.google.com with SMTP id j10so3547190otq.0; Fri, 26 Apr 2019 11:46:01 -0700 (PDT) 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:content-transfer-encoding :in-reply-to:user-agent; bh=pEPusRheoqG6L8hFDZ+UpNai2za15r7H5JF7WhwGE5Y=; b=e89yjqxLOaqEo5TAss3psn8IL/mYzV5RUDgjJ3BLRpLQc3HUJykv/2PKANhm870dP/ nPIffEA/n6a/qUfkxb3ZLsNz10QHzHf0ZwZxG1Rfc3DfNU3Tq6hl6iIvGYNBTN+ROXGe frfh2QFYDhoZ8/rXkN0eaZYqGUOzFRnx9y8IWO6kk6usN8UQkS9oDhpCkf4J0AlU0vE/ d1q39aC3ZnssN6MmofJ8Nj8+3CdtS2W+A/5QSVQoX+CyAvAc3XM2+1ak6D42eJEcqLJf X1U2sPsOeECnOQ8TpqTpXtrQnzg01ug1po9IS2ZD+G+mkmfOiLFrEVXn4sEAouoIh19f wLuA== X-Gm-Message-State: APjAAAVX5PBkiaPh7oNJhij9PDPSHkh04d959rAw26hoAXqHN5ejGWJe n8ASDys44SNMI1+WBtpxyQ== X-Received: by 2002:a05:6830:2090:: with SMTP id y16mr13359330otq.97.1556304360935; Fri, 26 Apr 2019 11:46:00 -0700 (PDT) Received: from localhost (24-155-109-49.dyn.grandenetworks.net. [24.155.109.49]) by smtp.gmail.com with ESMTPSA id o66sm11050999oig.11.2019.04.26.11.45.59 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Fri, 26 Apr 2019 11:45:59 -0700 (PDT) Date: Fri, 26 Apr 2019 13:45:59 -0500 From: Rob Herring To: =?iso-8859-1?Q?Ga=EBl?= PORTAY Cc: MyungJoo Ham , Kyungmin Park , Chanwoo Choi , 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, Mark Rutland Subject: Re: [PATCH v4 5/5] arm64: dts: rockchip: Enable dmc and dfi nodes on gru. Message-ID: <20190426184559.GA29242@bogus> References: <20190415212948.7736-1-gael.portay@collabora.com> <20190415212948.7736-6-gael.portay@collabora.com> MIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: <20190415212948.7736-6-gael.portay@collabora.com> User-Agent: Mutt/1.10.1 (2018-07-13) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Mon, Apr 15, 2019 at 05:29:48PM -0400, Ga?l PORTAY wrote: > From: Lin Huang > > Enable the DMC (Dynamic Memory Controller) and the DFI (DDR PHY > Interface) nodes on gru boards so we can support DDR DVFS. > > The patch also introduces a new file with default DRAM settings. > > Signed-off-by: Lin Huang > Signed-off-by: Enric Balletbo i Serra > Signed-off-by: Ga?l PORTAY > --- > > Changes in v4: > - [PATCH v3 5/5] Add board related DDR settings (moved from 4/5). > > Changes in v3: > - [PATCH v2 5/5] Remove display_subsystem nodes. > > Changes in v2: > - [PATCH 8/8] Move center-supply attribute of dmc node in file > rk3399-gru-chromebook.dtsi (where ppvar_centerlogic is > defined). > > Changes in v1: None > > .../dts/rockchip/rk3399-gru-chromebook.dtsi | 4 + > arch/arm64/boot/dts/rockchip/rk3399-gru.dtsi | 46 ++++++++++++ > .../boot/dts/rockchip/rk3399-op1-opp.dtsi | 29 ++++++++ > include/dt-bindings/power/rk3399-dram.h | 73 +++++++++++++++++++ > 4 files changed, 152 insertions(+) > create mode 100644 include/dt-bindings/power/rk3399-dram.h > > diff --git a/arch/arm64/boot/dts/rockchip/rk3399-gru-chromebook.dtsi b/arch/arm64/boot/dts/rockchip/rk3399-gru-chromebook.dtsi > index 931640e9aed4..cfb81356c61e 100644 > --- a/arch/arm64/boot/dts/rockchip/rk3399-gru-chromebook.dtsi > +++ b/arch/arm64/boot/dts/rockchip/rk3399-gru-chromebook.dtsi > @@ -400,3 +400,7 @@ ap_i2c_tp: &i2c5 { > rockchip,pins = <0 8 RK_FUNC_GPIO &pcfg_pull_none>; > }; > }; > + > +&dmc { > + center-supply = <&ppvar_centerlogic>; > +}; > diff --git a/arch/arm64/boot/dts/rockchip/rk3399-gru.dtsi b/arch/arm64/boot/dts/rockchip/rk3399-gru.dtsi > index da03fa9c5662..40e78186560b 100644 > --- a/arch/arm64/boot/dts/rockchip/rk3399-gru.dtsi > +++ b/arch/arm64/boot/dts/rockchip/rk3399-gru.dtsi > @@ -6,6 +6,7 @@ > */ > > #include > +#include > #include "rk3399.dtsi" > #include "rk3399-op1-opp.dtsi" > > @@ -289,6 +290,12 @@ > status = "okay"; > }; > > +&dmc_opp_table { > + opp04 { > + opp-suspend; > + }; > +}; > + > /* > * Set some suspend operating points to avoid OVP in suspend > * > @@ -489,6 +496,45 @@ ap_i2c_audio: &i2c8 { > status = "okay"; > }; > > +&dfi { > + status = "okay"; > +}; > + > +&dmc { > + status = "okay"; > + upthreshold = <25>; > + downdifferential = <15>; > + rockchip,ddr3_speed_bin = <21>; > + rockchip,pd_idle = <0x40>; > + rockchip,sr_idle = <0x2>; > + rockchip,sr_mc_gate_idle = <0x3>; > + rockchip,srpd_lite_idle = <0x4>; > + rockchip,standby_idle = <0x2000>; > + rockchip,dram_dll_dis_freq = <300000000>; > + rockchip,phy_dll_dis_freq = <125000000>; > + rockchip,auto_pd_dis_freq = <666000000>; > + rockchip,ddr3_odt_dis_freq = <333000000>; > + rockchip,ddr3_drv = ; > + rockchip,ddr3_odt = ; > + rockchip,phy_ddr3_ca_drv = ; > + rockchip,phy_ddr3_dq_drv = ; > + rockchip,phy_ddr3_odt = ; > + rockchip,lpddr3_odt_dis_freq = <333000000>; > + rockchip,lpddr3_drv = ; > + rockchip,lpddr3_odt = ; > + rockchip,phy_lpddr3_ca_drv = ; > + rockchip,phy_lpddr3_dq_drv = ; > + rockchip,phy_lpddr3_odt = ; > + rockchip,lpddr4_odt_dis_freq = <333000000>; > + rockchip,lpddr4_drv = ; > + rockchip,lpddr4_dq_odt = ; > + rockchip,lpddr4_ca_odt = ; > + rockchip,phy_lpddr4_ca_drv = ; > + rockchip,phy_lpddr4_ck_cs_drv = ; > + rockchip,phy_lpddr4_dq_drv = ; > + rockchip,phy_lpddr4_odt = ; > +}; > + > &sdhci { > /* > * Signal integrity isn't great at 200 MHz and 150 MHz (DDR) gives the > diff --git a/arch/arm64/boot/dts/rockchip/rk3399-op1-opp.dtsi b/arch/arm64/boot/dts/rockchip/rk3399-op1-opp.dtsi > index 69cc9b05baa5..c9e7032b01a8 100644 > --- a/arch/arm64/boot/dts/rockchip/rk3399-op1-opp.dtsi > +++ b/arch/arm64/boot/dts/rockchip/rk3399-op1-opp.dtsi > @@ -110,6 +110,31 @@ > opp-microvolt = <1075000>; > }; > }; > + > + dmc_opp_table: dmc_opp_table { > + compatible = "operating-points-v2"; > + > + opp00 { > + opp-hz = /bits/ 64 <200000000>; > + opp-microvolt = <900000>; > + }; > + opp01 { > + opp-hz = /bits/ 64 <400000000>; > + opp-microvolt = <900000>; > + }; > + opp02 { > + opp-hz = /bits/ 64 <666000000>; > + opp-microvolt = <900000>; > + }; > + opp03 { > + opp-hz = /bits/ 64 <800000000>; > + opp-microvolt = <900000>; > + }; > + opp04 { > + opp-hz = /bits/ 64 <928000000>; > + opp-microvolt = <900000>; > + }; > + }; > }; > > &cpu_l0 { > @@ -139,3 +164,7 @@ > &gpu { > operating-points-v2 = <&gpu_opp_table>; > }; > + > +&dmc { > + operating-points-v2 = <&dmc_opp_table>; > +}; > diff --git a/include/dt-bindings/power/rk3399-dram.h b/include/dt-bindings/power/rk3399-dram.h > new file mode 100644 > index 000000000000..4b3d4a79923b > --- /dev/null > +++ b/include/dt-bindings/power/rk3399-dram.h > @@ -0,0 +1,73 @@ > +/* SPDX-License-Identifier: (GPL-2.0+ OR X11) */ > +/* > + * Copyright (c) 2016-2018, Fuzhou Rockchip Electronics Co., Ltd > + * > + * Author: Lin Huang > + */ > + > +#ifndef _DTS_DRAM_ROCKCHIP_RK3399_H > +#define _DTS_DRAM_ROCKCHIP_RK3399_H > + > +#define DDR3_DS_34ohm 34 > +#define DDR3_DS_40ohm 40 > + > +#define DDR3_ODT_DIS 0 > +#define DDR3_ODT_40ohm 40 > +#define DDR3_ODT_60ohm 60 > +#define DDR3_ODT_120ohm 120 I don't think these defines add much value given the value is in the define itself. Do these get used by the driver? If not, then the header can go with the dts file. But I'd just get rid of the header. Rob