Received: by 2002:a25:ab43:0:0:0:0:0 with SMTP id u61csp2030180ybi; Thu, 20 Jun 2019 08:01:43 -0700 (PDT) X-Google-Smtp-Source: APXvYqyyUrhmRT9Altw8pNhFahUprvCXJuAlWFpJnvKn+qAlH7Hm1OQoJ0+/dxXYjLT20opZx7mh X-Received: by 2002:a17:90a:b298:: with SMTP id c24mr115823pjr.18.1561042903058; Thu, 20 Jun 2019 08:01:43 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1561042903; cv=none; d=google.com; s=arc-20160816; b=UuAFrKcPASoRmf35Bs/xI6etMEvcLzvf7WMtseXClfjnnQUilYVMjhFH6MjvuwcEGR hpc5ldRnfb7JIEMzAWgHqojF9nHiaZd6LMyykDIvHq2KzBeO1bpIWkwSE74czkUsAqv5 HigVmFAsZ749RJjAXHL8usZgO1YH86MQOCNeGwLjCq43rd9N+tvlU7gdXxtkUs1ATn+y Hb7BdkXbe4qt8FXyq9oO62k8OoQn6+Y1UdMv4nnwRSo2V3GbtzhOKt4iNnz4Y7P13R89 xDQGYCk09sTFVAbhVnIDA0LatnuqfXL6OvLDgNdTJh2W7pjYKEIt3cwFqtzrf1n/jDNc zVTA== 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=N2giQ2yIsAWn8MusPqgS1CP/DkqViRRuAeJS4LgppK4=; b=qBBsgPZAer3dhuOkVtXBiKmi96RmVRQT9wY3ni9s40i60gnmEEcFXnM/91eyS5ELU5 klRMURWN55nmuLcFMmj3OzeLqeFz7h6OtgDpCnZW2woASeBLRG1v3gEs1YkGhN1YSP7d JRut37iBB3t973e68ef8wqUMPOsOWYmhqhsk6BTHqPHcaGHRPvwUD/QkLfK4lZQo3uax SSuq3Sq4vhTguWRHfxnww7hAj3QOzWZgIHoelzOcwibMGxNIA8gwS6fDxaWNlFygHiaV yx5UoG+H4osGm4KTi95hgNq9EOiI17Od7Z+dGGv3P/6xiUkfrgccfISwjK+LSD4ZJHLX RuDA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@baylibre-com.20150623.gappssmtp.com header.s=20150623 header.b=b+LXYfMJ; 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 a14si6202645pga.567.2019.06.20.08.01.25; Thu, 20 Jun 2019 08:01:43 -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=b+LXYfMJ; 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 S1732181AbfFTPA7 (ORCPT + 99 others); Thu, 20 Jun 2019 11:00:59 -0400 Received: from mail-wr1-f46.google.com ([209.85.221.46]:34151 "EHLO mail-wr1-f46.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1732094AbfFTPAg (ORCPT ); Thu, 20 Jun 2019 11:00:36 -0400 Received: by mail-wr1-f46.google.com with SMTP id k11so3410645wrl.1 for ; Thu, 20 Jun 2019 08:00:35 -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=N2giQ2yIsAWn8MusPqgS1CP/DkqViRRuAeJS4LgppK4=; b=b+LXYfMJu8K3Irv+z9mH0+qqqhmw6l1ehg+Q35v6Z88zfJG1MOwscikQRxJh2njG4h WVzqtKd2aNO45HKxR7zXGNDOBYsvcURb2Un5PaXRJxB2sZI+M+6ns3+HXteJGNxoR4QD Igtbd+g2i4atWlx+tudsnSlm0177tLf1vM11HIZ5u1ymg8sRxUW8PdliGw6s62tFIm4m iG3L6EDDuwCh+LiAWnJqlJoO4pj8TdVbl4VWxYqLYTn60qxHgSrNlivcZf1nz1Xr/Uz3 OkSyYR+uuP8IQR1ixGDubknJlis/XNMdSD7/j0SVHd6+KD0/FJxAX0mXgvfKw/PW8+lW KNXA== 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=N2giQ2yIsAWn8MusPqgS1CP/DkqViRRuAeJS4LgppK4=; b=hyGCrXYsftjgn5NKA5NDAxpWTlihvC5muh3S1pv7yy4mJddostqae0gsCw2PeSgBv6 q5LY2208mhN6elKIwegcWATskVAmtkrGi9sxJNHaTKuJ1rNKl6q8jeuAcGuv7tE6Oh9i bq6kLgaG+zf+jwzdPbCbFUfuc/Y9vd3u4y76SY+X4KRkA+mM/ys6MZ8kH3kB+k8ZiQxp eCsysVkGk0lXJ9NwyMOJaeF7n08Ld8gN8wG62MEWWwkGMLVkoTTbQrtMgzyY08wAlEtf eGclhCLx885sFOPaIeSrffL19Xo4I9v3LMUeeU94Frk8ElrN6udIzsrqdtZR34krVOE7 gGaQ== X-Gm-Message-State: APjAAAWcUmCn2nzunbtJNmAbupDiH2IftA3HxAEt6iEhFuenUDDt3Xg1 M9mG9l8yz2UzxtNvODgYlcAC2g== X-Received: by 2002:a5d:494d:: with SMTP id r13mr5374600wrs.152.1561042834101; Thu, 20 Jun 2019 08:00:34 -0700 (PDT) Received: from bender.baylibre.local (lmontsouris-657-1-212-31.w90-63.abo.wanadoo.fr. [90.63.244.31]) by smtp.gmail.com with ESMTPSA id o126sm6802520wmo.1.2019.06.20.08.00.32 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Thu, 20 Jun 2019 08:00:33 -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, Neil Armstrong Subject: [RFC/RFT 12/14] arm64: dts: meson-g12a: enable DVFS on G12A boards Date: Thu, 20 Jun 2019 17:00:11 +0200 Message-Id: <20190620150013.13462-13-narmstrong@baylibre.com> X-Mailer: git-send-email 2.21.0 In-Reply-To: <20190620150013.13462-1-narmstrong@baylibre.com> References: <20190620150013.13462-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 | 55 +++++++++++++++++++ .../boot/dts/amlogic/meson-g12a-x96-max.dts | 52 ++++++++++++++++++ 3 files changed, 162 insertions(+) diff --git a/arch/arm64/boot/dts/amlogic/meson-g12a-sei510.dts b/arch/arm64/boot/dts/amlogic/meson-g12a-sei510.dts index bd26b35102ff..be45437c51e1 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 332a4b27174b..b6bd96ee394a 100644 --- a/arch/arm64/boot/dts/amlogic/meson-g12a-u200.dts +++ b/arch/arm64/boot/dts/amlogic/meson-g12a-u200.dts @@ -136,6 +136,25 @@ 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; + }; + sound { compatible = "amlogic,axg-sound-card"; model = "G12A-U200"; @@ -305,6 +324,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>; @@ -369,6 +416,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 d37868d21114..099ccf67547e 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