From patchwork Mon Feb 29 15:44:00 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Martin Sperl X-Patchwork-Id: 8455271 Return-Path: X-Original-To: patchwork-linux-arm@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork1.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.136]) by patchwork1.web.kernel.org (Postfix) with ESMTP id D20479F38C for ; Mon, 29 Feb 2016 15:48:10 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 040B6201FE for ; Mon, 29 Feb 2016 15:48:10 +0000 (UTC) Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.9]) (using TLSv1.2 with cipher AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 2DFD1201ED for ; Mon, 29 Feb 2016 15:48:09 +0000 (UTC) Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.80.1 #2 (Red Hat Linux)) id 1aaQ1p-00037e-RB; Mon, 29 Feb 2016 15:46:33 +0000 Received: from 212-186-180-163.dynamic.surfer.at ([212.186.180.163] helo=cgate.sperl.org) by bombadil.infradead.org with esmtp (Exim 4.80.1 #2 (Red Hat Linux)) id 1aaQ0D-0000SL-6T; Mon, 29 Feb 2016 15:44:55 +0000 Received: from raspcm.intern.sperl.org (account martin@sperl.org [10.10.10.41] verified) by sperl.org (CommuniGate Pro SMTP 6.1.2) with ESMTPSA id 6395007; Mon, 29 Feb 2016 15:44:11 +0000 From: kernel@martin.sperl.org To: Jonathan Corbet , Stephen Warren , Lee Jones , Eric Anholt , Michael Turquette , Stephen Boyd , Rob Herring , linux-doc@vger.kernel.org, linux-rpi-kernel@lists.infradead.org, linux-arm-kernel@lists.infradead.org, linux-clk@vger.kernel.org, devicetree@vger.kernel.org Subject: [PATCH 6/8] clk: bcm2835: add arm clock Date: Mon, 29 Feb 2016 15:44:00 +0000 Message-Id: <1456760642-2412-7-git-send-email-kernel@martin.sperl.org> X-Mailer: git-send-email 1.7.10.4 In-Reply-To: <1456760642-2412-1-git-send-email-kernel@martin.sperl.org> References: <1456760642-2412-1-git-send-email-kernel@martin.sperl.org> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20160229_074453_665076_5932FF80 X-CRM114-Status: GOOD ( 10.20 ) X-Spam-Score: -0.9 (/) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Martin Sperl MIME-Version: 1.0 Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org X-Spam-Status: No, score=-4.2 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_MED, RP_MATCHES_RCVD, UNPARSEABLE_RELAY autolearn=unavailable version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP From: Martin Sperl Add the missing "ARM" clock to the clock framework. This clock is essentially a gate clock but with a 16 channel mux. We assume this is a mux that uses PLLB_ARM, so a dedicated mux for arm was created. Signed-off-by: Martin Sperl --- drivers/clk/bcm/clk-bcm2835.c | 34 +++++++++++++++++++++++++++++++++- include/dt-bindings/clock/bcm2835.h | 1 + 2 files changed, 34 insertions(+), 1 deletion(-) diff --git a/drivers/clk/bcm/clk-bcm2835.c b/drivers/clk/bcm/clk-bcm2835.c index 91a6086..12ce209 100644 --- a/drivers/clk/bcm/clk-bcm2835.c +++ b/drivers/clk/bcm/clk-bcm2835.c @@ -118,6 +118,7 @@ #define CM_SDCCTL 0x1a8 #define CM_SDCDIV 0x1ac #define CM_ARMCTL 0x1b0 +#define CM_ARMDIV 0x1b4 #define CM_AVEOCTL 0x1b8 #define CM_AVEODIV 0x1bc #define CM_EMMCCTL 0x1c0 @@ -1542,11 +1543,33 @@ static const char * const bcm2835_clock_dsi1_parents[] = { .parents = bcm2835_clock_dsi1_parents, \ __VA_ARGS__) +/* arm parent mux */ +static const char * const bcm2835_clock_arm_parents[] = { + "gnd", + "xosc", + "testdebug0", + "testdebug1", + /* + * see comments for dsi0 for possible candidates + * should contain "pllb_arm" at one position + * plla_core/per + * pllb_arm or pllb_core/per + * pllc_core/per + * plld_core/per + * pllh_aux/pix + * up to 16 different parents + */ +}; + +#define REGISTER_ARM_CLK(...) REGISTER_CLK( \ + .num_mux_parents = ARRAY_SIZE(bcm2835_clock_arm_parents), \ + .parents = bcm2835_clock_arm_parents, \ + __VA_ARGS__) + /* * the real definition of all the pll, pll_dividers and clocks * these make use of the above REGISTER_* macros */ - static const struct bcm2835_clk_desc clk_desc_array[] = { /* the PLL + PLL dividers */ @@ -2038,6 +2061,15 @@ static const struct bcm2835_clk_desc clk_desc_array[] = { .int_bits = 1, .frac_bits = 0), + /* arm clocks */ + [BCM2835_CLOCK_DSI1_IMAGE] = REGISTER_ARM_CLK( + /* this is in principle a gate with a 4 bit mux */ + .name = "arm", + .ctl_reg = CM_ARMCTL, + .div_reg = CM_ARMDIV, + .int_bits = 1, + .frac_bits = 0), + /* the gates */ /* diff --git a/include/dt-bindings/clock/bcm2835.h b/include/dt-bindings/clock/bcm2835.h index 9254c78..109086e 100644 --- a/include/dt-bindings/clock/bcm2835.h +++ b/include/dt-bindings/clock/bcm2835.h @@ -70,3 +70,4 @@ #define BCM2835_CLOCK_DSI0_IMAGE 52 #define BCM2835_CLOCK_DSI1E 53 #define BCM2835_CLOCK_DSI1_IMAGE 54 +#define BCM2835_CLOCK_ARM 55