Received: by 2002:a25:ad19:0:0:0:0:0 with SMTP id y25csp1889983ybi; Mon, 1 Jul 2019 02:14:22 -0700 (PDT) X-Google-Smtp-Source: APXvYqxwEMYg7aEUa5MBkvbaXb/f/3vDd9cG+Ua13k9N/RV8zbBXbgNkbITNAZbjUaoFSGRk/zV8 X-Received: by 2002:a17:902:22e:: with SMTP id 43mr21135199plc.272.1561972462343; Mon, 01 Jul 2019 02:14:22 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1561972462; cv=none; d=google.com; s=arc-20160816; b=CUBD/2qdC3QGOzw9C061S+Q+XvZCiqJ1WfIkvoWXSl6jYY/S2v9W6oaC09onGbTx8V a/CD8vWkvGiXybmXMyaqUPR6Sdg4UVUWKNcVvACbYRXXoKsSlUCS88Ja9rDzFH5U1VCd Hdg+048ytCnahJEkGV7KJbUKr+guFWYaTV9klYRA6BTL8gydUoo0bgZNKy5mupNPltor l2wQMGWxchIVnceFoU14FzEvrBOzdwnYRDVwD6d46W0qe1G8jiyfPNLikAFx4G5i2pwV aH+JKFbA+wc9+F4EWxbBUPnTOtv9GyqhcCs9AAOv6kCzJFg1sD7n1tcZaF29O32IniLl kNIw== 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=GjwR8P1WN2zr3jyekwyJE7GslmESzQQSwJmGgaHfGbg=; b=C/qSUH2LFDFD8ycl7pkso/J6MaRgtayZgGOsdUjWHfZCA0okkmLqKGA1ZsuSK7zWjW KQ0zhIoCpo9HzopexGrJ48yn9EV+V6bR6g6dA2PReGngNr3vEMll/1kYfWzVEhCM3uiD rfkyYeC9/OG/33/CtCneXPkVGcQrmWCkzgptNt8wi2WATrIhzpK3asldowZkF54s3ux4 buII3YKPUxfgbnipsyH8dMgRJ8ITOEGFfJABXmKQ40doLVmSgr1ZbDezcESHeaWBCRrE FaHGR3O+1DuWPzVX9Ts2vEWQs5uFzOXe3ebtQ96DENQNJ00RUcapcj4K9DOn/IYxajb0 PT+g== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@baylibre-com.20150623.gappssmtp.com header.s=20150623 header.b=i2M8126m; 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 w21si9636718plq.91.2019.07.01.02.14.06; Mon, 01 Jul 2019 02:14:22 -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=i2M8126m; 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 S1728505AbfGAJNq (ORCPT + 99 others); Mon, 1 Jul 2019 05:13:46 -0400 Received: from mail-wm1-f48.google.com ([209.85.128.48]:40248 "EHLO mail-wm1-f48.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728448AbfGAJN1 (ORCPT ); Mon, 1 Jul 2019 05:13:27 -0400 Received: by mail-wm1-f48.google.com with SMTP id v19so15008768wmj.5 for ; Mon, 01 Jul 2019 02:13:26 -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=GjwR8P1WN2zr3jyekwyJE7GslmESzQQSwJmGgaHfGbg=; b=i2M8126mf8X3M4vK0EjuDX/AJytE9Pww/P65WWzwFfFVlL+EjQVVg00VFQu7SKzmP/ qgYng4GTe56VohSeptGBNoYvCLVCnGpPwCAC6XwFBxByMaDVo1iwiYgKH6qhLys+651i 8hhNaYVG98pa2Aztn+lCwEbybgHuAHp2GyasbIl1m3I88EO4R2Nn5aVk8jU4xXY7+W3w nm9Vz4x2caZXAuGVK8BILaXUDlu/g6FDZ3um5mbe2GjV4eWg8/d/jt7Rkn/nKTDuD2TT h5FrU847Ay2GHEUNr8TliJcckC4kL6R9nRIUzkiwfs+WGjUq9HFHybxezcZG4616+SMA olZQ== 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=GjwR8P1WN2zr3jyekwyJE7GslmESzQQSwJmGgaHfGbg=; b=pfqqZA4uO+BC4nbjfhp2CNyFXpHF7HsWPDWWlKzb00B5uvqqWJdcg261qPKcJjpt69 W/xqVr90AlO35hNpZhjon6aIf3Ll9s9JfvPj/yhYGqhclN817m3LhQlZ3zgu6SZfuYoA lZ2rWMGWTNy6c8QzPFja5Oqm/8rGQnTRnWEOKyorbsjc8/lujLe+VmNbXpnkTaUEjgXQ y6FKZwFXOuJtoHuiy4SMT71yDZeBqMOOAEATpllniVH1BO+oux627YNRHhKEu3NPpjpT 5WcjDtzGN3Fq43wQDed47EBFy9Ghp7ljZBbIuL4YR3/0dRNghgGGu3x0p+nqWVf14Cj6 HpRQ== X-Gm-Message-State: APjAAAUX/2zrcSEAa6itcCgBZSQajZe1wVJlP7TaffBovszO/rtr4nNh ZpTNiAgRBeFqBRj5Y1FF2mZV2g== X-Received: by 2002:a1c:7008:: with SMTP id l8mr15428817wmc.64.1561972405524; Mon, 01 Jul 2019 02:13:25 -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.24 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Mon, 01 Jul 2019 02:13:24 -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 14/14] arm64: dts: meson-g12b-odroid-n2: enable DVFS Date: Mon, 1 Jul 2019 11:12:58 +0200 Message-Id: <20190701091258.3870-15-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 Odroid-N2 by setting the clock, OPP and supply for each cores of each CPU clusters. The first cluster uses the "VDDCPU_B" power supply, and the second cluster uses the "VDDCPU_A" power supply. Each power supply can achieve 0.73V to 1.01V using 2 distinct PWM outputs 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 of each cluster 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-g12b-odroid-n2.dts | 96 +++++++++++++++++++ 1 file changed, 96 insertions(+) diff --git a/arch/arm64/boot/dts/amlogic/meson-g12b-odroid-n2.dts b/arch/arm64/boot/dts/amlogic/meson-g12b-odroid-n2.dts index 81780ffcc7f0..75ff8a7e373d 100644 --- a/arch/arm64/boot/dts/amlogic/meson-g12b-odroid-n2.dts +++ b/arch/arm64/boot/dts/amlogic/meson-g12b-odroid-n2.dts @@ -114,6 +114,44 @@ /* FIXME: actually controlled by VDDCPU_B_EN */ }; + vddcpu_a: regulator-vddcpu-a { + /* + * MP8756GD Regulator. + */ + compatible = "pwm-regulator"; + + regulator-name = "VDDCPU_A"; + regulator-min-microvolt = <721000>; + regulator-max-microvolt = <1022000>; + + vin-supply = <&main_12v>; + + pwms = <&pwm_ab 0 1250 0>; + pwm-dutycycle-range = <100 0>; + + regulator-boot-on; + regulator-always-on; + }; + + vddcpu_b: regulator-vddcpu-b { + /* + * Silergy SY8120B1ABC Regulator. + */ + compatible = "pwm-regulator"; + + regulator-name = "VDDCPU_B"; + 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; + }; + hub_5v: regulator-hub_5v { compatible = "regulator-fixed"; regulator-name = "HUB_5V"; @@ -245,6 +283,48 @@ status = "okay"; }; +&cpu0 { + cpu-supply = <&vddcpu_b>; + operating-points-v2 = <&cpu_opp_table_0>; + clocks = <&clkc CLKID_CPU_CLK>; + clock-latency = <50000>; +}; + +&cpu1 { + cpu-supply = <&vddcpu_b>; + operating-points-v2 = <&cpu_opp_table_0>; + clocks = <&clkc CLKID_CPU_CLK>; + clock-latency = <50000>; +}; + +&cpu100 { + cpu-supply = <&vddcpu_a>; + operating-points-v2 = <&cpub_opp_table_1>; + clocks = <&clkc CLKID_CPUB_CLK>; + clock-latency = <50000>; +}; + +&cpu101 { + cpu-supply = <&vddcpu_a>; + operating-points-v2 = <&cpub_opp_table_1>; + clocks = <&clkc CLKID_CPUB_CLK>; + clock-latency = <50000>; +}; + +&cpu102 { + cpu-supply = <&vddcpu_a>; + operating-points-v2 = <&cpub_opp_table_1>; + clocks = <&clkc CLKID_CPUB_CLK>; + clock-latency = <50000>; +}; + +&cpu103 { + cpu-supply = <&vddcpu_a>; + operating-points-v2 = <&cpub_opp_table_1>; + clocks = <&clkc CLKID_CPUB_CLK>; + clock-latency = <50000>; +}; + &ext_mdio { external_phy: ethernet-phy@0 { /* Realtek RTL8211F (0x001cc916) */ @@ -316,6 +396,22 @@ pinctrl-names = "default"; }; +&pwm_ab { + pinctrl-0 = <&pwm_a_e_pins>; + pinctrl-names = "default"; + clocks = <&xtal>; + clock-names = "clkin0"; + status = "okay"; +}; + +&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"; -- 2.21.0