Received: by 2002:a25:ad19:0:0:0:0:0 with SMTP id y25csp1889667ybi; Mon, 1 Jul 2019 02:14:02 -0700 (PDT) X-Google-Smtp-Source: APXvYqzUzxsc2kT9UAET09XPPG9u8DpDNAV3dmFA/8uo2GZcHD0xdcJzyxdXonc7ek9J78YfjIOo X-Received: by 2002:a63:2004:: with SMTP id g4mr1177279pgg.97.1561972441826; Mon, 01 Jul 2019 02:14:01 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1561972441; cv=none; d=google.com; s=arc-20160816; b=ONoLa7RSAZpDRRppCjbzHSHnuf5ay08vjgBj9/l5++nPlYCr7rxm/zq21CQzYpTwz0 hQE2jU4Xgpp3xaqVXLnWaRt9ppuKgRlYkHHUwuSKOHA28bMl8xnr47hW/5J8t8ZQlh8/ OBRg4S5CvC9qTYIS6xI0sU0h15y3/7PUcfWtnZ/+mXAhsfoKDclzCcSiTTFucw+A7D+9 wLQG+jFXk1woPRxIv5qEtLOJ29UMfEojrJNrLEyaS1eswEUW8hNcMPK76gMDs5lnx99v vzj9czWQe6bHL+x+aLpLjhoSZhsA0ZthfN/1gplt8i48iwu80UpBxwACnVxIzQP5iZEt WvLA== 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 :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=pKFqyT24saxMsVgjLwv9GUNIyi14AhWRJ+3bCNdCAgI=; b=Mu1u0ZXs+dH9pKuwYuLTzdtoIPVn00I6bRXSrs6KbJW405819jxAYQw3O51Grf4qzh uiJ24G7Jks9phIHdtIhEM7vXe6L/zOCQwUeWPXG9ImvoLtIi1MAIvdACfrou5aCVhbX/ V1i7BjGdRQKx0wasSRXLluaLvruWd9bMYf6BkolJYSpkjoiJ8nItAJ4//mqYwOvuBUiE Hxmi4Vx93AgqtZ+syr7q17wFYzpiS7KpsXQME5yWjYUwYZjdPaue12I3BALGn1R+yAj/ K0UqpEg8Dumzioe0jhTub1gC/9Js7VioZ3Dr++NdlXPWjWNDcdbwT3F3ZxeTZA13bHEe 7sdQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@baylibre-com.20150623.gappssmtp.com header.s=20150623 header.b=1kWbtQbq; 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 Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id j23si10462043pfh.215.2019.07.01.02.13.46; Mon, 01 Jul 2019 02:14:01 -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=@baylibre-com.20150623.gappssmtp.com header.s=20150623 header.b=1kWbtQbq; 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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728474AbfGAJNb (ORCPT + 99 others); Mon, 1 Jul 2019 05:13:31 -0400 Received: from mail-wm1-f53.google.com ([209.85.128.53]:55363 "EHLO mail-wm1-f53.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728435AbfGAJN0 (ORCPT ); Mon, 1 Jul 2019 05:13:26 -0400 Received: by mail-wm1-f53.google.com with SMTP id a15so15025527wmj.5 for ; Mon, 01 Jul 2019 02:13:24 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=baylibre-com.20150623.gappssmtp.com; s=20150623; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=pKFqyT24saxMsVgjLwv9GUNIyi14AhWRJ+3bCNdCAgI=; b=1kWbtQbq1nxbQC63T/XpzkI1bGwtGlerhgEMx+kxc0pQgj2wPjTx2ZkrPxNkiNtYVR QvTMhXJKpbfUFMHNBtt0gRw/DdJmljtN2vviE1a/Kh6IwaPqoBN5GIWG89HKlDu9h6+O NrDLXkBW6bur+y3GChGVFx/tqDc59mKh7OtJolQP8cKplj32MOFZsBOHUvCl/MGq86bl HniOo88CQGlcjjggbNtwqk6/ok9hkzmmSwVfEM5lN81rX614DgaklPROKxhHwn2VqfLX rNtNcEi9NMKVNheQrmGl+j+OlDfiptBGDgrfHSukP49m4GTQBh435o9fXivtRKLT1akn Jatg== 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:mime-version:content-transfer-encoding; bh=pKFqyT24saxMsVgjLwv9GUNIyi14AhWRJ+3bCNdCAgI=; b=MVo+h7yfYf9otsdFSQuhtND97oUFZipwKikmp4GKl1AB9eT48HLxP98oSItJmxUYl4 rBVfycAmvSVXV5zFfqfIlbPBKlrTb0YWImwZK1LnIJr2m3gfu9zILw7fOBsgDGkIrVcr USuU4WkdiViQLNWusCvbp27w0pn6FwvCy6KPXsE3Jue40yW02JN8s12X4AAZ6lm8dpTN v7RFPiP0g/mQecOAmLTHDv4CM+JF9qRsuaon/Uxyir2jhmUDaGLkH3JJT6IljvVsyX5/ hpdGEI2txIvRpvEla9ZUviDMgrZnpNagqCBb3HyOOoBxLj1gXhXkzm4cP/VtHeHIA094 UheA== X-Gm-Message-State: APjAAAXI9IcdfjVl23jsnlGvyhSb9R5bgGw0inI7P8oMpPgYU6YdMKYw oMcuTFgpDu8O0xhj7JtXdc/XFA== X-Received: by 2002:a1c:65c3:: with SMTP id z186mr17343352wmb.116.1561972403521; Mon, 01 Jul 2019 02:13:23 -0700 (PDT) Received: from localhost.localdomain (176-150-251-154.abo.bbox.fr. [176.150.251.154]) by smtp.gmail.com with ESMTPSA id i16sm6305659wrm.37.2019.07.01.02.13.22 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Mon, 01 Jul 2019 02:13:22 -0700 (PDT) From: Neil Armstrong To: jbrunet@baylibre.com, khilman@baylibre.com Cc: linux-arm-kernel@lists.infradead.org, linux-amlogic@lists.infradead.org, linux-kernel@vger.kernel.org, linux-clk@vger.kernel.org, martin.blumenstingl@googlemail.com, linux-gpio@vger.kernel.org, Neil Armstrong Subject: [RFC/RFT v3 12/14] arm64: dts: meson-g12a: enable DVFS on G12A boards Date: Mon, 1 Jul 2019 11:12:56 +0200 Message-Id: <20190701091258.3870-13-narmstrong@baylibre.com> X-Mailer: git-send-email 2.21.0 In-Reply-To: <20190701091258.3870-1-narmstrong@baylibre.com> References: <20190701091258.3870-1-narmstrong@baylibre.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Enable DVFS for the U200, SEI520 and X96-Max Amlogic G12A based board by setting the clock, OPP and supply for each CPU cores. The CPU cluster power supply can achieve 0.73V to 1.01V using a PWM output clocked at 800KHz with an inverse duty-cycle. DVFS has been tested by running the arm64 cpuburn at [1] and cycling between all the possible cpufreq translations and checking the final frequency using the clock-measurer, script at [2]. [1] https://github.com/ssvb/cpuburn-arm/blob/master/cpuburn-a53.S [2] https://gist.github.com/superna9999/d4de964dbc0f84b7d527e1df2ddea25f Signed-off-by: Neil Armstrong --- .../boot/dts/amlogic/meson-g12a-sei510.dts | 55 +++++++++++++++++++ .../boot/dts/amlogic/meson-g12a-u200.dts | 54 ++++++++++++++++++ .../boot/dts/amlogic/meson-g12a-x96-max.dts | 52 ++++++++++++++++++ 3 files changed, 161 insertions(+) diff --git a/arch/arm64/boot/dts/amlogic/meson-g12a-sei510.dts b/arch/arm64/boot/dts/amlogic/meson-g12a-sei510.dts index c7a87368850b..979449968a5f 100644 --- a/arch/arm64/boot/dts/amlogic/meson-g12a-sei510.dts +++ b/arch/arm64/boot/dts/amlogic/meson-g12a-sei510.dts @@ -129,6 +129,25 @@ enable-active-high; }; + vddcpu: regulator-vddcpu { + /* + * SY8120B1ABC DC/DC Regulator. + */ + compatible = "pwm-regulator"; + + regulator-name = "VDDCPU"; + regulator-min-microvolt = <721000>; + regulator-max-microvolt = <1022000>; + + vin-supply = <&dc_in>; + + pwms = <&pwm_AO_cd 1 1250 0>; + pwm-dutycycle-range = <100 0>; + + regulator-boot-on; + regulator-always-on; + }; + vddio_ao1v8: regulator-vddio_ao1v8 { compatible = "regulator-fixed"; regulator-name = "VDDIO_AO1V8"; @@ -297,6 +316,34 @@ status = "okay"; }; +&cpu0 { + cpu-supply = <&vddcpu>; + operating-points-v2 = <&cpu_opp_table>; + clocks = <&clkc CLKID_CPU_CLK>; + clock-latency = <50000>; +}; + +&cpu1 { + cpu-supply = <&vddcpu>; + operating-points-v2 = <&cpu_opp_table>; + clocks = <&clkc CLKID_CPU_CLK>; + clock-latency = <50000>; +}; + +&cpu2 { + cpu-supply = <&vddcpu>; + operating-points-v2 = <&cpu_opp_table>; + clocks = <&clkc CLKID_CPU_CLK>; + clock-latency = <50000>; +}; + +&cpu3 { + cpu-supply = <&vddcpu>; + operating-points-v2 = <&cpu_opp_table>; + clocks = <&clkc CLKID_CPU_CLK>; + clock-latency = <50000>; +}; + &cvbs_vdac_port { cvbs_vdac_out: endpoint { remote-endpoint = <&cvbs_connector_in>; @@ -339,6 +386,14 @@ pinctrl-names = "default"; }; +&pwm_AO_cd { + pinctrl-0 = <&pwm_ao_d_e_pins>; + pinctrl-names = "default"; + clocks = <&xtal>; + clock-names = "clkin1"; + status = "okay"; +}; + &pwm_ef { status = "okay"; pinctrl-0 = <&pwm_e_pins>; diff --git a/arch/arm64/boot/dts/amlogic/meson-g12a-u200.dts b/arch/arm64/boot/dts/amlogic/meson-g12a-u200.dts index 8551fbd4a488..2a324f0136e3 100644 --- a/arch/arm64/boot/dts/amlogic/meson-g12a-u200.dts +++ b/arch/arm64/boot/dts/amlogic/meson-g12a-u200.dts @@ -129,6 +129,24 @@ regulator-always-on; }; + vddcpu: regulator-vddcpu { + /* + * MP8756GD Regulator. + */ + compatible = "pwm-regulator"; + + regulator-name = "VDDCPU"; + regulator-min-microvolt = <721000>; + regulator-max-microvolt = <1022000>; + + vin-supply = <&main_12v>; + + pwms = <&pwm_AO_cd 1 1250 0>; + pwm-dutycycle-range = <100 0>; + + regulator-boot-on; + regulator-always-on; + }; }; &cec_AO { @@ -145,6 +163,34 @@ hdmi-phandle = <&hdmi_tx>; }; +&cpu0 { + cpu-supply = <&vddcpu>; + operating-points-v2 = <&cpu_opp_table>; + clocks = <&clkc CLKID_CPU_CLK>; + clock-latency = <50000>; +}; + +&cpu1 { + cpu-supply = <&vddcpu>; + operating-points-v2 = <&cpu_opp_table>; + clocks = <&clkc CLKID_CPU_CLK>; + clock-latency = <50000>; +}; + +&cpu2 { + cpu-supply = <&vddcpu>; + operating-points-v2 = <&cpu_opp_table>; + clocks = <&clkc CLKID_CPU_CLK>; + clock-latency = <50000>; +}; + +&cpu3 { + cpu-supply = <&vddcpu>; + operating-points-v2 = <&cpu_opp_table>; + clocks = <&clkc CLKID_CPU_CLK>; + clock-latency = <50000>; +}; + &cvbs_vdac_port { cvbs_vdac_out: endpoint { remote-endpoint = <&cvbs_connector_in>; @@ -197,6 +243,14 @@ pinctrl-names = "default"; }; +&pwm_AO_cd { + pinctrl-0 = <&pwm_ao_d_e_pins>; + pinctrl-names = "default"; + clocks = <&xtal>; + clock-names = "clkin1"; + status = "okay"; +}; + /* SD card */ &sd_emmc_b { status = "okay"; diff --git a/arch/arm64/boot/dts/amlogic/meson-g12a-x96-max.dts b/arch/arm64/boot/dts/amlogic/meson-g12a-x96-max.dts index fe4013cca876..c1e58a69d434 100644 --- a/arch/arm64/boot/dts/amlogic/meson-g12a-x96-max.dts +++ b/arch/arm64/boot/dts/amlogic/meson-g12a-x96-max.dts @@ -132,6 +132,22 @@ regulator-always-on; }; + vddcpu: regulator-vddcpu { + compatible = "pwm-regulator"; + + regulator-name = "VDDCPU"; + regulator-min-microvolt = <721000>; + regulator-max-microvolt = <1022000>; + + vin-supply = <&dc_in>; + + pwms = <&pwm_AO_cd 1 1250 0>; + pwm-dutycycle-range = <100 0>; + + regulator-boot-on; + regulator-always-on; + }; + sound { compatible = "amlogic,axg-sound-card"; model = "G12A-X96-MAX"; @@ -242,6 +258,34 @@ status = "okay"; }; +&cpu0 { + cpu-supply = <&vddcpu>; + operating-points-v2 = <&cpu_opp_table>; + clocks = <&clkc CLKID_CPU_CLK>; + clock-latency = <50000>; +}; + +&cpu1 { + cpu-supply = <&vddcpu>; + operating-points-v2 = <&cpu_opp_table>; + clocks = <&clkc CLKID_CPU_CLK>; + clock-latency = <50000>; +}; + +&cpu2 { + cpu-supply = <&vddcpu>; + operating-points-v2 = <&cpu_opp_table>; + clocks = <&clkc CLKID_CPU_CLK>; + clock-latency = <50000>; +}; + +&cpu3 { + cpu-supply = <&vddcpu>; + operating-points-v2 = <&cpu_opp_table>; + clocks = <&clkc CLKID_CPU_CLK>; + clock-latency = <50000>; +}; + &cvbs_vdac_port { cvbs_vdac_out: endpoint { remote-endpoint = <&cvbs_connector_in>; @@ -279,6 +323,14 @@ pinctrl-names = "default"; }; +&pwm_AO_cd { + pinctrl-0 = <&pwm_ao_d_e_pins>; + pinctrl-names = "default"; + clocks = <&xtal>; + clock-names = "clkin1"; + status = "okay"; +}; + &ext_mdio { external_phy: ethernet-phy@0 { /* Realtek RTL8211F (0x001cc916) */ -- 2.21.0