From patchwork Thu Sep 13 20:29:16 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Martin Blumenstingl X-Patchwork-Id: 10600067 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id ECCF214F9 for ; Thu, 13 Sep 2018 20:33:34 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id D9F8A2A5F9 for ; Thu, 13 Sep 2018 20:33:34 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id CA6192B4DB; Thu, 13 Sep 2018 20:33:34 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-2.9 required=2.0 tests=BAYES_00,DKIM_ADSP_CUSTOM_MED, DKIM_SIGNED,DKIM_VALID,FREEMAIL_FROM,MAILING_LIST_MULTI,RCVD_IN_DNSWL_NONE autolearn=ham version=3.3.1 Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id 299302A5F9 for ; Thu, 13 Sep 2018 20:33:34 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20170209; h=Sender: Content-Transfer-Encoding:Content-Type:Cc:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:References:In-Reply-To: Message-Id:Date:Subject:To:From:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=sgy3r2LYjWwwEhMWi30b68Ga9P2VEOK2mStOfUVL0m4=; b=U9Rx+pOHUrO2+u p4zBszp8VDiKdpOLdfVYDesDUES5Uan3cbaFKj+8aroyUI2uzUNASlcEHJr4LEYbPCtFB9r1aeAL/ H/Pw/Lz+oFyyH46LHZtinB8kWYkxQIlmLQdmyyOakijIqZ/elMIicq5vaejqAPoG+kK8IdCTo09Ws 6PbPaGWul5WUNvN/uT4bWboEyJR1dLML4O8izk0+C55VWFSGvZUlYVNPFvuH38coV4UPXjOQwyiQ4 PYzQK12PME1bhF/BvC0o6y8S9+0dWg3rYiTGZ1VG2z/PFfbDAy5CgrRMRZi9RKa9g1Sr939MxohiB zwkfLcgwDtOhVj6YOHEg==; Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.90_1 #2 (Red Hat Linux)) id 1g0YIi-0001Ch-VH; Thu, 13 Sep 2018 20:33:21 +0000 Received: from mail-wm1-f68.google.com ([209.85.128.68]) by bombadil.infradead.org with esmtps (Exim 4.90_1 #2 (Red Hat Linux)) id 1g0YF9-0006gY-2n; Thu, 13 Sep 2018 20:30:04 +0000 Received: by mail-wm1-f68.google.com with SMTP id s12-v6so93813wmc.0; Thu, 13 Sep 2018 13:29:28 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=googlemail.com; s=20161025; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=hLeIs94Wo3ta7UfkhFfKKo6COsbQz27rvtbRMJCHnO0=; b=rK5HrkbDykA0VEjsxwg/VWGmgbH5FFR8rg3u4+PlisX/O4P5urMC41fb36ksLh/8kg YKVbJ+hTW+2atly3ws4cHXMRE1jBHKYY+SIKvpG87187tc91+tpH/irXDdQcv2KJUs5A 4XYk2opliGuIfVXEyliIB4U3COgefSSgVDUhcTxXrde8Tp+ZpJPp3nbgBVdauc21Fkac VsoslxAcHillmT4dGLxa2E2gj4kSJTcZNiqHQZmUEX50YCvKSOI9SrvG3lxb/cwphaFb MKEUYx10TRSpXmMV+VzBBxT32bmAP+ZQR4W24unoboJqMTLgrIa0kRiFc36ZJHkrdsXq whag== 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=hLeIs94Wo3ta7UfkhFfKKo6COsbQz27rvtbRMJCHnO0=; b=oiiHTqJ71D503nLwlpvwqgNFkDFvGh2AKZ3Xw0yMlFnBrORx3uphiaJfYhCrmSXAIV xDDM8L9pyrvRAq3IJE0icVT5Mwc1jxqXJ7qx5Ml/fYcTb//1JDvq1+Ol0Iw+7sH50UIs jDJ4zeYhmGZY4yxSR4CfVmKWc3B3leB0Eurg30F9J2a+Z8vKxMzeQOK3LfgaZ0jOLoNJ o050M5VUEaofKSJ1ID0EpnNkECTKV92yzhI14iw/Ny2iZkg6D3a0uocQBRVjkJpW3LmG qkHkbMiJeeUAdwjLgDxd5Y9FTZDEiLhCgWi6TBmSu0CW/Xsgdh48oBKOQGK0J+xYy2Vs MCuQ== X-Gm-Message-State: APzg51B7jnsgTLJH80/iqWjZ0v2PBXA5EN/GcMi13cNcAuWha6tlAzGz U09ZQ83DLqQSDVYgMiiy/6bHVjjU X-Google-Smtp-Source: ANB0VdbwmPF2cyb7wEOrSnTzhU+Q06ciTpZaEmUU/5GV+xtCPwQenPCVcDhgHbLIrvcoiBIlRhVcoQ== X-Received: by 2002:a1c:40d5:: with SMTP id n204-v6mr6863221wma.44.1536870565852; Thu, 13 Sep 2018 13:29:25 -0700 (PDT) Received: from blackbox.darklights.net (p200300DCD72E2B00B426A3A246F82EA8.dip0.t-ipconnect.de. [2003:dc:d72e:2b00:b426:a3a2:46f8:2ea8]) by smtp.googlemail.com with ESMTPSA id e7-v6sm6076254wru.46.2018.09.13.13.29.24 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 13 Sep 2018 13:29:25 -0700 (PDT) From: Martin Blumenstingl To: linux-amlogic@lists.infradead.org, khilman@baylibre.com, carlo@caione.org Subject: [PATCH 1/4] ARM: dts: meson8b: odroidc1: add the CPU voltage regulator Date: Thu, 13 Sep 2018 22:29:16 +0200 Message-Id: <20180913202919.20927-2-martin.blumenstingl@googlemail.com> X-Mailer: git-send-email 2.19.0 In-Reply-To: <20180913202919.20927-1-martin.blumenstingl@googlemail.com> References: <20180913202919.20927-1-martin.blumenstingl@googlemail.com> MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20180913_132939_209583_AB050320 X-CRM114-Status: GOOD ( 12.00 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Martin Blumenstingl , linux-arm-kernel@lists.infradead.org Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org X-Virus-Scanned: ClamAV using ClamSMTP The CPU voltage regulator is a "Monolithic Power Systems MP2161" (according to the Odroid-C1+'s schematics). It is driven by PWM_C on GPIODV_9. Hardkernel's 3.10 kernel (based on the Amlogic GPL kernel sources) defines a PWM voltage table with the following values: - 0.86 volts = PWM register value 0x10f001b - (more values in 0.1 volt increments) - 1.14 volts = PWM register value 0x000012a When using the XTAL (24MHz) as input this translates into a PWM period of 12218ns with 0.86V using a duty cycle of 91% and 1.14V using a duty cycle of 0%. Signed-off-by: Martin Blumenstingl --- arch/arm/boot/dts/meson8b-odroidc1.dts | 27 ++++++++++++++++++++++++++ 1 file changed, 27 insertions(+) diff --git a/arch/arm/boot/dts/meson8b-odroidc1.dts b/arch/arm/boot/dts/meson8b-odroidc1.dts index ef3177d3da3d..0557823cdd64 100644 --- a/arch/arm/boot/dts/meson8b-odroidc1.dts +++ b/arch/arm/boot/dts/meson8b-odroidc1.dts @@ -101,6 +101,25 @@ states = <3300000 0 1800000 1>; }; + + vcck: regulator-vcck { + /* Monolithic Power Systems MP2161 */ + compatible = "pwm-regulator"; + + regulator-name = "VCCK"; + regulator-min-microvolt = <860000>; + regulator-max-microvolt = <1140000>; + + pwms = <&pwm_cd 0 12218 0>; + pwm-dutycycle-range = <91 0>; + + regulator-boot-on; + regulator-always-on; + }; +}; + +&cpu0 { + cpu-supply = <&vcck>; }; ðmac { @@ -180,6 +199,14 @@ }; }; +&pwm_cd { + status = "okay"; + pinctrl-0 = <&pwm_c1_pins>; + pinctrl-names = "default"; + clocks = <&clkc CLKID_XTAL>; + clock-names = "clkin0"; +}; + &uart_AO { status = "okay"; pinctrl-0 = <&uart_ao_a_pins>;