Received: by 2002:a25:ad19:0:0:0:0:0 with SMTP id y25csp3684493ybi; Mon, 29 Jul 2019 10:44:16 -0700 (PDT) X-Google-Smtp-Source: APXvYqxtlm/Xh1Ob2h9SgXQwJAnfrZJ68eHtC9OSfXdzzgX1Za6+8iyM5FJ8vpAhWsW2/l0qP4q5 X-Received: by 2002:a65:50c8:: with SMTP id s8mr65633223pgp.339.1564422256518; Mon, 29 Jul 2019 10:44:16 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1564422256; cv=none; d=google.com; s=arc-20160816; b=O/lbG+qS97gsCqZOSiFewSsHxu0jGpq7rMgQ4CxC3eA4FF2SGOwpT7y6+n35gPOCv6 3CEKoFUTIQ/f+Y92aqe8XdJ1CHjvqd1PHZEgzhFQ3F5RT2TkNkU9SB4tf9Z2Pg0J3pvs amoLxUnjf8Nf6VwuRg1HjPh+4tb8EBLI2mH1wQBxdu/1ZwvxaB6u1/tb7Zv6FcBt4e8E 5aq2ILbuGH8l62Nwz3U/LmEE8yUlau3SbCk421ATq8edm1hbsZIpvqH3QJVjHVA7BJxy 9nhcKdvn6/QkWDPwgiWLLNGPMkhcvWRTM5fKbfY6SWCeP9PMgW/rzaju3Qra1wprl+02 Msdg== 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=H599BftyGgZGeuvjylSPb30Ip+K44PQz6UV6QIRWDVA=; b=zJZaAQ/Lq1wCfiuxEjA9UtpwjpEp8bT8hZSZgu0gOhxX5ogaq8B5+rWFlqqUZnVyL2 P+QxRNWZBI4GqNUomxdI8C3UQIbakW8md0inicoyK2yeSvCBK5FEGCaVqF0fl3AOWSS3 UtjJpN9stIQKFEMjZoL9odCzuC7yBQiIHbLTA1vnkwC/7RbNrusfiY2kzP3YAoKNUpU+ k54pdGG3wMkElnt2MK7tkwvNl6f7JNc7iHnfOB/fBae8yNqzExPyi4VlFvxjfFG5uKK5 y23r1AAyyePPzb5G1PPigBDm8pAOTwVeCWgaFDB2802K3jAxEINRXCEHwiba8CPteoXS RdmA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@baylibre-com.20150623.gappssmtp.com header.s=20150623 header.b=OFeOg7Jg; 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 v31si25492493pjb.22.2019.07.29.10.44.01; Mon, 29 Jul 2019 10:44:16 -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=OFeOg7Jg; 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 S1728017AbfG2N0d (ORCPT + 99 others); Mon, 29 Jul 2019 09:26:33 -0400 Received: from mail-wr1-f66.google.com ([209.85.221.66]:39896 "EHLO mail-wr1-f66.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726716AbfG2N0b (ORCPT ); Mon, 29 Jul 2019 09:26:31 -0400 Received: by mail-wr1-f66.google.com with SMTP id x4so8691896wrt.6 for ; Mon, 29 Jul 2019 06:26:29 -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=H599BftyGgZGeuvjylSPb30Ip+K44PQz6UV6QIRWDVA=; b=OFeOg7JgBUV4RUYsWPEYo3tVjVMt4zr3MoUttpQJUKwKE+8z0skTH00a2umzu3bxxM i5qPoI3jqZdagq6pZ7zl8TH2dblrPWgyUYU7BFeg3b6kBf9YohCl1VGNsRrNpddoOm1W ytMZM1U7GVPvMPpMLfOfLAYZd91D6+WquCcVXqSxVrgOj/1nNR2Qk0oRuujmH0WztgE9 v5cDuHocm3L76O/GWoDlwdj6IFlW+5PB6Jvv6Ois5LMj7R/lqOedrREPKmx66UzKgWAX IMeBRGlA9S9FSybigDdxOD4/iaSkQ+HAnSug8auDSxIAclUT1aIllD/N4lOq0gRKsTuJ nGbA== 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=H599BftyGgZGeuvjylSPb30Ip+K44PQz6UV6QIRWDVA=; b=QXYfv0/k6aO+IhXqcT4GlKYoDuJukIZ/+ocAEDlN/oEskmSPuGgl6jBaA5swSSxcZg XRHeqY7LH0GAjfSDfWL6/t2arsrd1DXoHmBMS04vYVd387IOITXkDEPVWckt/SJU0u3z cgMDzGRZGtzmDcSTKG94Yiya+Q/0h/trGfOX19ndMzJDEANSS/Q1dcZrYAGbQqqH5YHk olH6S8KRYZNjLutcIOAbZmLLWleNxd157jvgIdCKxRkbtJfahhYJNKeM9OZ1UNNWY5A0 b0fdctVL4bcEtlfIoBnmKpX6WVyK/uIsE6AYA7lRYwBrzhhe4pnT6Hw4jv4MGKncS+4v sYhw== X-Gm-Message-State: APjAAAWWm26YUj3G/64/xh1yMribC/a8Pek3aQTFiNIugC7jv1EOOazO zL5ae2tsoQZawlf9j7xPwkfxjQ== X-Received: by 2002:a5d:518d:: with SMTP id k13mr25880915wrv.40.1564406788248; Mon, 29 Jul 2019 06:26:28 -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 y2sm50270053wrl.4.2019.07.29.06.26.26 (version=TLS1_3 cipher=AEAD-AES256-GCM-SHA384 bits=256/256); Mon, 29 Jul 2019 06:26:27 -0700 (PDT) From: Neil Armstrong To: khilman@baylibre.com Cc: Neil Armstrong , linux-amlogic@lists.infradead.org, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, Martin Blumenstingl Subject: [PATCH 4/6] arm64: dts: meson-g12a: enable DVFS on G12A boards Date: Mon, 29 Jul 2019 15:26:20 +0200 Message-Id: <20190729132622.7566-5-narmstrong@baylibre.com> X-Mailer: git-send-email 2.22.0 In-Reply-To: <20190729132622.7566-1-narmstrong@baylibre.com> References: <20190729132622.7566-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 Reviewed-by: Martin Blumenstingl 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 12aa7eaeaf68..c9fa23a56562 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>; @@ -345,6 +392,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.22.0