From patchwork Tue Oct 18 00:29:12 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Fabio Estevam X-Patchwork-Id: 9380917 X-Patchwork-Delegate: sboyd@codeaurora.org Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id 88BFD6086B for ; Tue, 18 Oct 2016 00:29:29 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 7927028FF2 for ; Tue, 18 Oct 2016 00:29:29 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 6D7AB28FF0; Tue, 18 Oct 2016 00:29:29 +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=-6.8 required=2.0 tests=BAYES_00, DKIM_ADSP_CUSTOM_MED, DKIM_SIGNED, FREEMAIL_FROM, RCVD_IN_DNSWL_HI, T_DKIM_INVALID autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 1A56928FF0 for ; Tue, 18 Oct 2016 00:29:28 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S934039AbcJRA31 (ORCPT ); Mon, 17 Oct 2016 20:29:27 -0400 Received: from mail-vk0-f65.google.com ([209.85.213.65]:36785 "EHLO mail-vk0-f65.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S932779AbcJRA30 (ORCPT ); Mon, 17 Oct 2016 20:29:26 -0400 Received: by mail-vk0-f65.google.com with SMTP id b186so8856102vkb.3 for ; Mon, 17 Oct 2016 17:29:26 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=from:to:cc:subject:date:message-id; bh=gguKgYxVy45HqK46XEn859nTfalb95VBuIupbx6bVbA=; b=W+nuydNuFL+A+Pd+KQa767WkO4oL7CNf/ZTzeZaLC+ZO0D0K9Mc6Qv6O71LNcY1TvD jejChSULrch1qmJFpjXzG+0PN76S5ded2nCvzM3bGDkfodghyxPyV/hUOzhD1CNqNDOY qj4NZg/g0o6+ZnnHFGerp74TI67W8nxgjh7MZPXxEO7ipt+8E8tKFrkUm/RQvbNwTqgc sZQj6Fvl04Lzhd0KDvB85V6Yt8EhTvzcCSU17QzwGJuqSTxzl12P88tSpJs0Qq5AAkvu HH4zmSspVoWMXTHjzHlhWjtK81o2PrZA1cb4pa9Ji0eiaIR1NHTXXSby8Jdl1g+1g2cd rB3w== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:from:to:cc:subject:date:message-id; bh=gguKgYxVy45HqK46XEn859nTfalb95VBuIupbx6bVbA=; b=lGha47ddXTxq12m/mTfvaDLW7AeIE6A8hNmnYiZxV54wPNYXfYfhtMdQCHUjtAu8lc 6RED66HrueD9aJpPn8CZHPuHGYUK/laX4b1LDjOseWmb1KmfYQxuYBOB9gz0NeEVSdoR +l0cb9woCjoEv9yY0kG1Tekls329qBkOl3TCrWtAaplp9nFVGcQgkVrQadorI794Hag9 uGlG+OAE6t0gCDrB3EnHZA3vw7xO+gagXDTgp4v037TKVH2svPdpiuFDYjSJvqphMjTe Dcy0eQwuDJt0ZijpabyssNmfI3Mfbr1WCwgw2RY1Y1mOEdTsCjOb+sxnhC+ymA/Oalxd eJxg== X-Gm-Message-State: AA6/9RkEnQNcYPRnrPB4AqR1q0vcMN91x+sF2+qrU8zlpJQk+ZId2Y6J444shetKdNVrzg== X-Received: by 10.31.6.207 with SMTP id 198mr115979vkg.19.1476750565960; Mon, 17 Oct 2016 17:29:25 -0700 (PDT) Received: from localhost.localdomain ([2804:14c:482:75c:b07a:d1b9:1470:e9c]) by smtp.gmail.com with ESMTPSA id y76sm6247544vkc.23.2016.10.17.17.29.24 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Mon, 17 Oct 2016 17:29:25 -0700 (PDT) From: Fabio Estevam To: sboyd@codeaurora.org Cc: shawnguo@kernel.org, kernel@pengutronix.de, linux-clk@vger.kernel.org, linux-arm-kernel@lists.infradead.org, Philipp Zabel , Fabio Estevam Subject: [PATCH RESEND 1/3] clk: imx6: Mask mmdc_ch1 handshake for periph2_sel and mmdc_ch1_axi_podf Date: Mon, 17 Oct 2016 22:29:12 -0200 Message-Id: <1476750554-21961-1-git-send-email-festevam@gmail.com> X-Mailer: git-send-email 2.7.4 Sender: linux-clk-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-clk@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP From: Philipp Zabel MMDC CH1 is not used on i.MX6Q, so the handshake needed to change the parent of periph2_sel or the divider of mmdc_ch1_axi_podf will never succeed. Disable the handshake mechanism to allow changing the frequency of mmdc_ch1_axi, allowing to use it as a possible source for the LDB DI clock. Signed-off-by: Philipp Zabel Signed-off-by: Fabio Estevam --- drivers/clk/imx/clk-imx6q.c | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/drivers/clk/imx/clk-imx6q.c b/drivers/clk/imx/clk-imx6q.c index ce8ea10..66825a8 100644 --- a/drivers/clk/imx/clk-imx6q.c +++ b/drivers/clk/imx/clk-imx6q.c @@ -156,6 +156,19 @@ static struct clk ** const uart_clks[] __initconst = { NULL }; +#define CCM_CCDR 0x04 + +#define CCDR_MMDC_CH1_MASK BIT(16) + +static void __init imx6q_mmdc_ch1_mask_handshake(void __iomem *ccm_base) +{ + unsigned int reg; + + reg = readl_relaxed(ccm_base + CCM_CCDR); + reg |= CCDR_MMDC_CH1_MASK; + writel_relaxed(reg, ccm_base + CCM_CCDR); +} + static void __init imx6q_clocks_init(struct device_node *ccm_node) { struct device_node *np; @@ -297,6 +310,8 @@ static void __init imx6q_clocks_init(struct device_node *ccm_node) base = of_iomap(np, 0); WARN_ON(!base); + imx6q_mmdc_ch1_mask_handshake(base); + /* name reg shift width parent_names num_parents */ clk[IMX6QDL_CLK_STEP] = imx_clk_mux("step", base + 0xc, 8, 1, step_sels, ARRAY_SIZE(step_sels)); clk[IMX6QDL_CLK_PLL1_SW] = imx_clk_mux("pll1_sw", base + 0xc, 2, 1, pll1_sw_sels, ARRAY_SIZE(pll1_sw_sels));